Skip to content

Commit

Permalink
Merge pull request #8 from SoftCreatR/arm
Browse files Browse the repository at this point in the history
Add arm support
  • Loading branch information
eldadfux authored Oct 10, 2020
2 parents 47d8edd + 9481a2d commit ef315cb
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 20 deletions.
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
notifications:
email:
- [email protected]

language: minimal

arch:
- amd64
- arm64

os: linux

before_install:
- curl -fsSL https://get.docker.com | sh
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json
- mkdir -p $HOME/.docker
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json
- sudo service docker start

install:
- docker-compose up -d

script:
- sleep 10
- docker ps -a
- docker-compose logs telegraf
- >
if : >/dev/tcp/localhost/8094; then
echo 'Connection available.'
travis_terminate 0
else
echo 'Connection unavailable.'
travis_terminate 1
fi
50 changes: 48 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
FROM telegraf:1.7
FROM alpine:3.12

LABEL maintainer="[email protected]"

COPY ./telegraf.conf /etc/telegraf/telegraf.conf
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf

RUN apk add --no-cache \
tzdata \
bash \
ca-certificates && \
rm -rf /var/cache/apk/* && \
update-ca-certificates 2>/dev/null

ENV TELEGRAF_VERSION 1.15.3

RUN set -ex && \
mkdir ~/.gnupg; \
echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
apk add --no-cache --virtual .build-deps wget gnupg tar && \
for key in \
05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \
do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \
done && \
[ "$(uname -m)" = x86_64 ] && suffix="_static_linux_amd64.tar.gz" || suffix="_linux_armhf.tar.gz"; \
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}${suffix}.asc && \
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}${suffix} && \
gpg --batch --verify telegraf-${TELEGRAF_VERSION}${suffix}.asc telegraf-${TELEGRAF_VERSION}${suffix} && \
mkdir -p /usr/src && \
tar -C /usr/src -xzf telegraf-${TELEGRAF_VERSION}${suffix} && \
cd /usr/src/telegraf-${TELEGRAF_VERSION}*; \
cp -R etc/* /etc; \
cp -R usr/* /usr; \
cp -R var/* /var; \
find /usr/bin -name "telegraf*" -exec chmod +x {} \; && \
gpgconf --kill all && \
rm -rf telegraf* /usr/src /root/.gnupg && \
apk del .build-deps

COPY telegraf.conf /etc/telegraf/telegraf.conf

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]

EXPOSE 8125/udp 8092/udp 8094
27 changes: 14 additions & 13 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
The MIT License (MIT)
MIT License

Copyright (c) 2019 Appwrite.io
Copyright (c) 2020 Appwrite

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Docker Telegraf

[![Build Status](https://travis-ci.com/appwrite/docker-telegraf.svg?branch=main)](https://travis-ci.com/appwrite/docker-telegraf)
![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/telegraf.svg)
[![Discord](https://img.shields.io/discord/564160730845151244)](https://discord.gg/GSeTUeA)

Telegraf container pre-configured for [Appwrite server](https://appwrite.io) installation. This container is only extending the official Telegraf docker image with Appwrite specific configuration settings, for a fresh installation of Telegraf use only [docker official image](https://hub.docker.com/_/telegraf).
Telegraf Docker image pre-configured for [Appwrite server](https://appwrite.io) installation. This container is only extending the official Telegraf docker image with Appwrite specific configuration settings, for a fresh installation of Telegraf use only [docker official image](https://hub.docker.com/_/telegraf).

## Getting Started

Expand All @@ -23,14 +24,24 @@ In order to run this container you'll need docker installed.
docker run appwrite/telegraf
```

### Versioning

This image versioning is following Appwrite server versioning. This means that if you use Appwrite server version 1.1.* , also use version 1.1.* of Appwrite Telegraf docker image.

### Environment Variables

This container supports all environment variables supplied by the official Telegraf Docker image.

### Build / Release

```
docker build --tag appwrite/telegraf:0.0.0 .
docker push appwrite/telegraf:0.0.0
```

Multi-arch build (experimental using [buildx](https://github.com/docker/buildx)):

```
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 --tag appwrite/telegraf:0.0.0 . --push
```

## Find Us

* [GitHub](https://github.com/appwrite)
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: '3'

services:
telegraf:
build: .
restart: unless-stopped
ports:
- "8125:8125/udp"
- "8092:8092/udp"
- "8094:8094/tcp"
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

if [ "${1:0:1}" = '-' ]; then
set -- telegraf "$@"
fi

exec "$@"

0 comments on commit ef315cb

Please sign in to comment.