Merge pull request #118 from gizmoguy/docker-img-build

Add docker image building via github actions.
pull/56/head^2
berthubert 2020-07-09 23:45:10 +02:00 committed by GitHub
commit 85abcd5602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 8 deletions

32
.github/workflows/docker.yml vendored 100644
View File

@ -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 \
.

View File

@ -1,4 +1,4 @@
FROM ubuntu:disco
FROM ubuntu:eoan
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8

View File

@ -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
-------