From c94f6bad24503713b947c31e2c9686f2110c014b Mon Sep 17 00:00:00 2001 From: Brad Cowie Date: Sun, 2 Feb 2020 13:58:47 +1300 Subject: [PATCH] Add docker image building via github actions. --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 2 +- README.md | 21 ++++++++++++++------- 3 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..824e24d --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,32 @@ +name: Build and publish Docker image + +on: + push: + branches: master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Set up docker buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v3 + with: + buildx-version: latest + qemu-version: latest + - name: Login to docker registry + run: | + docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }} + - name: Run buildx + run: | + docker buildx build \ + --tag galmon/galmon \ + --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 \ + --output "type=registry" \ + --build-arg MAKE_FLAGS=-j1 \ + --file Dockerfile \ + . diff --git a/Dockerfile b/Dockerfile index 7081bbc..d8d5a5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:disco +FROM ubuntu:eoan ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL C.UTF-8 diff --git a/README.md b/README.md index e53f083..75f32ed 100644 --- a/README.md +++ b/README.md @@ -92,22 +92,29 @@ library installed. If you get an error about 'wslay', do the following, and run echo WSLAY=-lwslay > Makefile.local ``` -Build in Docker ---------------- +Running in Docker +----------------- -To build it in Docker: +We publish official Docker images for galmon on +[docker hub](https://hub.docker.com/r/faucet/faucet) for multiple architectures. + +To run a container with a shell in there (this will also expose a port so you +can view the UI too and assumes a ublox GPS device too - +you may need to tweak as necessary): ``` -git clone https://github.com/ahupowerdns/galmon.git --recursive -docker build -t galmon --build-arg MAKE_FLAGS=-j2 . +docker run -it --rm --device=/dev/ttyACM0 -p 10000:10000 galmon/galmon ``` -To run a container with a shell in there (this will also expose a port so you can view the UI too and assumes a ublox GPS device too - you may need to tweak as necessary): +Running a daemonized docker container reporting data to a remote server +might look like: ``` -docker run -it --rm --device=/dev/ttyACM0 -p 10000:10000 galmon +docker run -d --restart=always --device=/dev/ttyACM0 --name=galmon galmon/galmon /galmon/ubxtool --wait --port /dev/ttyACM0 --gps --galileo --glonass --destination [server] --station [station-id] --owner [owner] ``` +To make your docker container update automatically you could use a tool such as +[watchtower](https://containrrr.github.io/watchtower/). Running -------