From ea8fd94926aa6cf88411430b5300a8484528d041 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Sat, 7 Mar 2020 15:56:48 +0100 Subject: [PATCH 01/20] add dockerfile for server, add docker-compose, change dockerfile for client --- config/client.yaml | 2 +- docker-compose.yaml | 14 ++++++++++++++ Dockerfile => docker/dockerfiles/Client.Dockerfile | 0 docker/dockerfiles/Server.Dockerfile | 13 +++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml rename Dockerfile => docker/dockerfiles/Client.Dockerfile (100%) create mode 100644 docker/dockerfiles/Server.Dockerfile diff --git a/config/client.yaml b/config/client.yaml index 907e7fc1..8398d5b4 100644 --- a/config/client.yaml +++ b/config/client.yaml @@ -16,7 +16,7 @@ client: sendDelay: 3 # time in seconds to delay the resend try server: # only used if useBroadcast = no - ip: 127.0.0.1 + ip: 127.0.0.1 # use service name if you are running docker port: 8080 inputSource: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..cb89532f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,14 @@ +version: '3' +services: + client: + build: + dockerfile: docker/dockerfiles/Client.Dockerfile + context: . + command: python /opt/boswatch/bw_client.py -c client.yaml + devices: + - "/dev/bus/usb" + server: + build: + dockerfile: docker/dockerfiles/Server.Dockerfile + context: . + command: python /opt/boswatch/bw_server.py -c server.yaml \ No newline at end of file diff --git a/Dockerfile b/docker/dockerfiles/Client.Dockerfile similarity index 100% rename from Dockerfile rename to docker/dockerfiles/Client.Dockerfile diff --git a/docker/dockerfiles/Server.Dockerfile b/docker/dockerfiles/Server.Dockerfile new file mode 100644 index 00000000..e8f284fb --- /dev/null +++ b/docker/dockerfiles/Server.Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:3.10 AS boswatch +ARG BW_VERSION=develop +RUN apk add git && \ + git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch + +FROM python:3.6-alpine AS runner +LABEL maintainer="bastian@schroll-software.de" + +RUN pip3 install pyyaml + +RUN mkdir /log/ +COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ +COPY ./config/* /opt/boswatch/config/ From d8e8662c7d242aecffc7c593c3a86279b3220088 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Sat, 11 Apr 2020 16:06:24 +0200 Subject: [PATCH 02/20] add newline in docker-compose.yaml --- docker-compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cb89532f..0b52ce3f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,4 +11,5 @@ services: build: dockerfile: docker/dockerfiles/Server.Dockerfile context: . - command: python /opt/boswatch/bw_server.py -c server.yaml \ No newline at end of file + command: python /opt/boswatch/bw_server.py -c server.yaml + From 6d3fe8499a30342b70efc39deadb2bbb8152eeb9 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 19:29:07 +0200 Subject: [PATCH 03/20] move Dockerfiles, change paths in docker-compose.yaml, change default config for paths in Dockerfile, add Dockerfile for build, --- Dockerfile | 31 +++++++++++++++++++ docker-compose.yaml | 4 +-- .../Client.Dockerfile | 0 .../Server.Dockerfile | 0 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100755 Dockerfile rename docker/{dockerfiles => localdev}/Client.Dockerfile (100%) rename docker/{dockerfiles => localdev}/Server.Dockerfile (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 00000000..2cc71ba1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM alpine:3.10 AS build-base +RUN apk add git make cmake g++ libusb-dev libpulse + +FROM build-base AS rtl_fm +ARG RTL_SDR_VERSION=0.6.0 +RUN git clone --depth 1 --branch ${RTL_SDR_VERSION} https://github.com/osmocom/rtl-sdr.git /opt/rtl_sdr +WORKDIR /opt/rtl_sdr/build +RUN cmake .. && make + +FROM build-base AS multimon +ARG MULTIMON_VERSION=1.1.8 +RUN git clone --depth 1 --branch ${MULTIMON_VERSION} https://github.com/EliasOenal/multimon-ng.git /opt/multimon +WORKDIR /opt/multimon/build +RUN cmake .. && make + +FROM alpine:3.10 AS boswatch +ARG BW_VERSION=develop +RUN apk add git && \ + git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch + + +FROM python:3.6-alpine AS runner +LABEL maintainer="bastian@schroll-software.de" + +# for RTL for MM +RUN apk add libusb-dev libpulse && \ + pip3 install pyyaml + +COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ +COPY --from=multimon /opt/multimon/build/multimon-ng /opt/multimon/multimon-ng +COPY --from=rtl_fm /opt/rtl_sdr/build/src/ /opt/rtl_sdr/ diff --git a/docker-compose.yaml b/docker-compose.yaml index 0b52ce3f..f003223a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,14 +2,14 @@ version: '3' services: client: build: - dockerfile: docker/dockerfiles/Client.Dockerfile + dockerfile: docker/localdev/Client.Dockerfile context: . command: python /opt/boswatch/bw_client.py -c client.yaml devices: - "/dev/bus/usb" server: build: - dockerfile: docker/dockerfiles/Server.Dockerfile + dockerfile: docker/localdev/Server.Dockerfile context: . command: python /opt/boswatch/bw_server.py -c server.yaml diff --git a/docker/dockerfiles/Client.Dockerfile b/docker/localdev/Client.Dockerfile similarity index 100% rename from docker/dockerfiles/Client.Dockerfile rename to docker/localdev/Client.Dockerfile diff --git a/docker/dockerfiles/Server.Dockerfile b/docker/localdev/Server.Dockerfile similarity index 100% rename from docker/dockerfiles/Server.Dockerfile rename to docker/localdev/Server.Dockerfile From 48648913f8a5d716a74f7c6afb228347e227bd94 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 19:40:29 +0200 Subject: [PATCH 04/20] add build_image workflow --- .github/workflows/build_image.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/build_image.yml diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml new file mode 100644 index 00000000..9b00ff66 --- /dev/null +++ b/.github/workflows/build_image.yml @@ -0,0 +1,17 @@ +name: Build Docker Image + +on: + push: + branches: [ master, feature/docker ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag boswatch:$(date +%s) + From cf33db9c6451cf50bb505b23e7cf3a0987ef19b4 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 19:49:56 +0200 Subject: [PATCH 05/20] Add github package push --- .github/workflows/build_image.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 9b00ff66..ff0db3d5 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -14,4 +14,7 @@ jobs: - uses: actions/checkout@v2 - name: Build the Docker image run: docker build . --file Dockerfile --tag boswatch:$(date +%s) - + - name: docker login + run: docker login docker.pkg.github.com --username janspeller + - name: Push the Docker image to Github Packages + run: docker tag boswatch docker.pkg.github.com/janspeller/BW3-Core/boswatch:latest From 93b84b48764b602dcd7252e5c9a72403ffc7824f Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 20:03:06 +0200 Subject: [PATCH 06/20] add secrets --- .github/workflows/build_image.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index ff0db3d5..a8698238 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -15,6 +15,9 @@ jobs: - name: Build the Docker image run: docker build . --file Dockerfile --tag boswatch:$(date +%s) - name: docker login - run: docker login docker.pkg.github.com --username janspeller + env: + GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }} + GH_PACKAGES_PASSWORD: ${{ secrets.GH_PACKAGES_PASSWORD }} + run: docker login docker.pkg.github.com --username $GH_PACKAGES_USERNAME --password $GH_PACKAGES_PASSWORD - name: Push the Docker image to Github Packages run: docker tag boswatch docker.pkg.github.com/janspeller/BW3-Core/boswatch:latest From 1836223f95a59d26fa8f7da2eb3f42bab94a9c7d Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 20:07:33 +0200 Subject: [PATCH 07/20] rename repo to lowercase --- .github/workflows/build_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index a8698238..198b460f 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -20,4 +20,4 @@ jobs: GH_PACKAGES_PASSWORD: ${{ secrets.GH_PACKAGES_PASSWORD }} run: docker login docker.pkg.github.com --username $GH_PACKAGES_USERNAME --password $GH_PACKAGES_PASSWORD - name: Push the Docker image to Github Packages - run: docker tag boswatch docker.pkg.github.com/janspeller/BW3-Core/boswatch:latest + run: docker tag boswatch docker.pkg.github.com/janspeller/bw3-core/boswatch:latest From 2862123fe6a1aea0ada4f858e6e54afde0265a7e Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 20:13:14 +0200 Subject: [PATCH 08/20] add push --- .github/workflows/build_image.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 198b460f..24031099 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -13,11 +13,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: docker build . --file Dockerfile --tag boswatch:$(date +%s) + run: docker build . --file Dockerfile --tag boswatch:latest - name: docker login env: GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }} GH_PACKAGES_PASSWORD: ${{ secrets.GH_PACKAGES_PASSWORD }} run: docker login docker.pkg.github.com --username $GH_PACKAGES_USERNAME --password $GH_PACKAGES_PASSWORD - - name: Push the Docker image to Github Packages + - name: Rename the Docker image run: docker tag boswatch docker.pkg.github.com/janspeller/bw3-core/boswatch:latest + - name: Push the Docker image to Github package repository + run: docker push docker.pkg.github.com/janspeller/bw3-core/boswatch:latest From 47c75772d1db081278cb9f320d21be2a2ec714bb Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 13 Apr 2020 20:40:51 +0200 Subject: [PATCH 09/20] change target repo --- .github/workflows/build_image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 24031099..f1742bd2 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -2,7 +2,7 @@ name: Build Docker Image on: push: - branches: [ master, feature/docker ] + branches: [ master ] jobs: @@ -22,4 +22,4 @@ jobs: - name: Rename the Docker image run: docker tag boswatch docker.pkg.github.com/janspeller/bw3-core/boswatch:latest - name: Push the Docker image to Github package repository - run: docker push docker.pkg.github.com/janspeller/bw3-core/boswatch:latest + run: docker push docker.pkg.github.com/BOSWatch/bw3-core/boswatch:latest From 20da06ab91351cc0e745c44cc38164fa6a49efc4 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:42:44 +0200 Subject: [PATCH 10/20] Update Dockerfile, add Build for Images, change docker-compose to use images --- .github/workflows/build_image.yml | 20 +++++++++++--------- Dockerfile | 23 +++++++++++++++-------- docker-compose.yaml | 11 ++--------- docker/localdev/Server.Dockerfile | 13 ------------- requirements.txt | 2 +- 5 files changed, 29 insertions(+), 40 deletions(-) delete mode 100644 docker/localdev/Server.Dockerfile diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index f1742bd2..9af78189 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -12,14 +12,16 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag boswatch:latest + - name: Build the Docker image for the Client + run: docker build . --file Dockerfile --target client --tag docker.pkg.github.com/janspeller/bw3-core/client:latest + - name: Build the Docker image for the Server + run: docker build . --file Dockerfile --target server --tag docker.pkg.github.com/janspeller/bw3-core/server:latest - name: docker login env: - GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }} - GH_PACKAGES_PASSWORD: ${{ secrets.GH_PACKAGES_PASSWORD }} - run: docker login docker.pkg.github.com --username $GH_PACKAGES_USERNAME --password $GH_PACKAGES_PASSWORD - - name: Rename the Docker image - run: docker tag boswatch docker.pkg.github.com/janspeller/bw3-core/boswatch:latest - - name: Push the Docker image to Github package repository - run: docker push docker.pkg.github.com/BOSWatch/bw3-core/boswatch:latest + GH_USERNAME: ${{ secrets.GH_USERNAME }} + GH_PAT: ${{ secrets.GH_PAT }} + run: echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin + - name: Push the Client Docker image to Github package repository + run: docker push docker.pkg.github.com/BOSWatch/bw3-core/client:latest + - name: Push the Server Docker image to Github package repository + run: docker push docker.pkg.github.com/BOSWatch/bw3-core/se4rver:latest diff --git a/Dockerfile b/Dockerfile index 2cc71ba1..945a804d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,23 @@ -FROM alpine:3.10 AS build-base -RUN apk add git make cmake g++ libusb-dev libpulse +FROM alpine:latest AS build-base +RUN apk add --no-cache git make cmake g++ libusb-dev libpulse FROM build-base AS rtl_fm -ARG RTL_SDR_VERSION=0.6.0 -RUN git clone --depth 1 --branch ${RTL_SDR_VERSION} https://github.com/osmocom/rtl-sdr.git /opt/rtl_sdr +RUN git clone --depth 1 https://gitea.osmocom.org/sdr/rtl-sdr.git /opt/rtl_sdr WORKDIR /opt/rtl_sdr/build RUN cmake .. && make FROM build-base AS multimon -ARG MULTIMON_VERSION=1.1.8 -RUN git clone --depth 1 --branch ${MULTIMON_VERSION} https://github.com/EliasOenal/multimon-ng.git /opt/multimon +RUN git clone --depth 1 https://github.com/EliasOenal/multimon-ng.git /opt/multimon WORKDIR /opt/multimon/build RUN cmake .. && make -FROM alpine:3.10 AS boswatch +FROM alpine:latest AS boswatch ARG BW_VERSION=develop RUN apk add git && \ git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch -FROM python:3.6-alpine AS runner +FROM python:alpine AS boswatch-base LABEL maintainer="bastian@schroll-software.de" # for RTL for MM @@ -27,5 +25,14 @@ RUN apk add libusb-dev libpulse && \ pip3 install pyyaml COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ +RUN mkdir /opt/boswatch/log COPY --from=multimon /opt/multimon/build/multimon-ng /opt/multimon/multimon-ng COPY --from=rtl_fm /opt/rtl_sdr/build/src/ /opt/rtl_sdr/ +WORKDIR /opt/boswatch + +FROM boswatch-base AS client +CMD python3 /opt/boswatch/bw_client.py -c client.yaml + +FROM boswatch-base AS server +CMD python3 /opt/boswatch/bw_server.py -c server.yaml +EXPOSE 8080 diff --git a/docker-compose.yaml b/docker-compose.yaml index f003223a..4e7e07d2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,8 @@ version: '3' services: client: - build: - dockerfile: docker/localdev/Client.Dockerfile - context: . - command: python /opt/boswatch/bw_client.py -c client.yaml + image: docker.pkg.github.com/janspeller/bw3-core/client:latest devices: - "/dev/bus/usb" server: - build: - dockerfile: docker/localdev/Server.Dockerfile - context: . - command: python /opt/boswatch/bw_server.py -c server.yaml - + image: docker.pkg.github.com/janspeller/bw3-core/server:latest diff --git a/docker/localdev/Server.Dockerfile b/docker/localdev/Server.Dockerfile deleted file mode 100644 index e8f284fb..00000000 --- a/docker/localdev/Server.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM alpine:3.10 AS boswatch -ARG BW_VERSION=develop -RUN apk add git && \ - git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch - -FROM python:3.6-alpine AS runner -LABEL maintainer="bastian@schroll-software.de" - -RUN pip3 install pyyaml - -RUN mkdir /log/ -COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ -COPY ./config/* /opt/boswatch/config/ diff --git a/requirements.txt b/requirements.txt index 5e215ff0..8ea1afb9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ pyyaml # for documentation generating mkdocs -# for develope only +# for develop only pytest pytest-cov pytest-flake8 From 7c728ce1992a0cc6b3dc926e11ced8254e273476 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:46:26 +0200 Subject: [PATCH 11/20] Add Trigger --- .github/workflows/build_image.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 9af78189..a8cc24d4 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -2,14 +2,13 @@ name: Build Docker Image on: push: - branches: [ master ] + branches: + - master + - feature/docker jobs: - build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Build the Docker image for the Client From 2d2374df5bcf4a4edc6144ac8ecd3faa1984b240 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:47:15 +0200 Subject: [PATCH 12/20] typo --- .github/workflows/build_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index a8cc24d4..914524e0 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -23,4 +23,4 @@ jobs: - name: Push the Client Docker image to Github package repository run: docker push docker.pkg.github.com/BOSWatch/bw3-core/client:latest - name: Push the Server Docker image to Github package repository - run: docker push docker.pkg.github.com/BOSWatch/bw3-core/se4rver:latest + run: docker push docker.pkg.github.com/BOSWatch/bw3-core/server:latest From f3c2fbe4502897f8e1a1122325d2810ac344fa44 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:52:24 +0200 Subject: [PATCH 13/20] fix docker login --- .github/workflows/build_image.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 914524e0..2f3eac40 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -15,11 +15,12 @@ jobs: run: docker build . --file Dockerfile --target client --tag docker.pkg.github.com/janspeller/bw3-core/client:latest - name: Build the Docker image for the Server run: docker build . --file Dockerfile --target server --tag docker.pkg.github.com/janspeller/bw3-core/server:latest - - name: docker login - env: - GH_USERNAME: ${{ secrets.GH_USERNAME }} - GH_PAT: ${{ secrets.GH_PAT }} - run: echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GH_PAT }} - name: Push the Client Docker image to Github package repository run: docker push docker.pkg.github.com/BOSWatch/bw3-core/client:latest - name: Push the Server Docker image to Github package repository From b574c8693f4b6dd57540734d95ce153624a63ff4 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:55:44 +0200 Subject: [PATCH 14/20] fix docker repo path --- .github/workflows/build_image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 2f3eac40..7cb8f2de 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -22,6 +22,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GH_PAT }} - name: Push the Client Docker image to Github package repository - run: docker push docker.pkg.github.com/BOSWatch/bw3-core/client:latest + run: docker push docker.pkg.github.com/janspeller/bw3-core/client:latest - name: Push the Server Docker image to Github package repository - run: docker push docker.pkg.github.com/BOSWatch/bw3-core/server:latest + run: docker push docker.pkg.github.com/janspeller/bw3-core/server:latest From 06f0e01649e9332dff24d8ec36774537126450c5 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 4 May 2022 23:58:08 +0200 Subject: [PATCH 15/20] fix docker repo path --- .github/workflows/build_image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 7cb8f2de..e6c04ea4 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -12,9 +12,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image for the Client - run: docker build . --file Dockerfile --target client --tag docker.pkg.github.com/janspeller/bw3-core/client:latest + run: docker build . --file Dockerfile --target client --tag ghcr.io/janspeller/bw3-core/client:latest - name: Build the Docker image for the Server - run: docker build . --file Dockerfile --target server --tag docker.pkg.github.com/janspeller/bw3-core/server:latest + run: docker build . --file Dockerfile --target server --tag ghcr.io/janspeller/bw3-core/server:latest - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: @@ -22,6 +22,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GH_PAT }} - name: Push the Client Docker image to Github package repository - run: docker push docker.pkg.github.com/janspeller/bw3-core/client:latest + run: docker push ghcr.io/janspeller/bw3-core/client:latest - name: Push the Server Docker image to Github package repository - run: docker push docker.pkg.github.com/janspeller/bw3-core/server:latest + run: docker push ghcr.io/janspeller/bw3-core/server:latest From 74c8f40afba8198beeb2855ae8d88c75ecef2207 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Sat, 21 May 2022 16:41:25 +0200 Subject: [PATCH 16/20] Fix Multimon Path Variable, change rtlPath to Container Path, add config volume to docker compose file, fix Dockerfile --- Dockerfile | 19 +++++++++++-------- config/client.yaml | 4 ++-- docker-compose.yaml | 4 ++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 945a804d..340d73bf 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM build-base AS rtl_fm RUN git clone --depth 1 https://gitea.osmocom.org/sdr/rtl-sdr.git /opt/rtl_sdr WORKDIR /opt/rtl_sdr/build RUN cmake .. && make +RUN make install FROM build-base AS multimon RUN git clone --depth 1 https://github.com/EliasOenal/multimon-ng.git /opt/multimon @@ -17,22 +18,24 @@ RUN apk add git && \ git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch -FROM python:alpine AS boswatch-base +FROM python:alpine AS client LABEL maintainer="bastian@schroll-software.de" # for RTL for MM -RUN apk add libusb-dev libpulse && \ - pip3 install pyyaml +RUN apk add libusb-dev libpulse +RUN pip3 install pyyaml COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ -RUN mkdir /opt/boswatch/log COPY --from=multimon /opt/multimon/build/multimon-ng /opt/multimon/multimon-ng -COPY --from=rtl_fm /opt/rtl_sdr/build/src/ /opt/rtl_sdr/ -WORKDIR /opt/boswatch +COPY --from=rtl_fm /usr/local/bin/rtl_fm /opt/rtl_sdr/rtl_fm +COPY --from=rtl_fm /usr/local/lib/librtlsdr.so.0 /usr/local/lib/librtlsdr.so.0 -FROM boswatch-base AS client +WORKDIR /opt/boswatch CMD python3 /opt/boswatch/bw_client.py -c client.yaml -FROM boswatch-base AS server +FROM python:alpine AS server +RUN pip3 install pyyaml +COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ +WORKDIR /opt/boswatch CMD python3 /opt/boswatch/bw_server.py -c server.yaml EXPOSE 8080 diff --git a/config/client.yaml b/config/client.yaml index 8398d5b4..2c852ed0 100644 --- a/config/client.yaml +++ b/config/client.yaml @@ -27,7 +27,7 @@ inputSource: squelch: 1 gain: 100 #fir_size: 0 - rtlPath: /usr/local/bin/rtl_fm + rtlPath: /opt/rtl_sdr/rtl_fm lineIn: card: 1 device: 0 @@ -38,5 +38,5 @@ decoder: poc512: yes poc1200: yes poc2400: yes - Path: /opt/multimon/multimon-ng + path: /opt/multimon/multimon-ng char: DE diff --git a/docker-compose.yaml b/docker-compose.yaml index 4e7e07d2..fc30d89f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,11 @@ version: '3' services: client: image: docker.pkg.github.com/janspeller/bw3-core/client:latest + volumes: + - ./config:/opt/boswatch/config devices: - "/dev/bus/usb" server: image: docker.pkg.github.com/janspeller/bw3-core/server:latest + volumes: + - ./config:/opt/boswatch/config From 17e761d5cb1869357aa97a9689191a1ee3267217 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Sat, 21 May 2022 16:55:56 +0200 Subject: [PATCH 17/20] Remove old dockerfile --- docker/localdev/Client.Dockerfile | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 docker/localdev/Client.Dockerfile diff --git a/docker/localdev/Client.Dockerfile b/docker/localdev/Client.Dockerfile deleted file mode 100644 index 8ac0c9fc..00000000 --- a/docker/localdev/Client.Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM alpine:3.13 AS build-base -RUN apk add git make cmake g++ libusb-dev libpulse - -FROM build-base AS rtl_fm -ARG RTL_SDR_VERSION=0.6.0 -RUN git clone --depth 1 --branch ${RTL_SDR_VERSION} https://github.com/osmocom/rtl-sdr.git /opt/rtl_sdr -WORKDIR /opt/rtl_sdr/build -RUN cmake .. && make - -FROM build-base AS multimon -ARG MULTIMON_VERSION=1.1.9 -RUN git clone --depth 1 --branch ${MULTIMON_VERSION} https://github.com/EliasOenal/multimon-ng.git /opt/multimon -WORKDIR /opt/multimon/build -RUN cmake .. && make - -FROM alpine:3.13 AS boswatch -ARG BW_VERSION=develop -RUN apk add git && \ - git clone --depth 1 --branch ${BW_VERSION} https://github.com/BOSWatch/BW3-Core.git /opt/boswatch - - -FROM python:3.9.1-alpine AS runner -LABEL maintainer="bastian@schroll-software.de" - -# for RTL for MM -RUN apk add libusb-dev libpulse && \ - pip3 install pyyaml - -COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ -COPY --from=multimon /opt/multimon/build/multimon-ng /opt/multimon-ng -COPY --from=rtl_fm /opt/rtl_sdr/build/src/ /opt/rtl_sdr From 3be1c11100644b04726117f43ccd7a8cca8e3719 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Sat, 21 May 2022 17:08:12 +0200 Subject: [PATCH 18/20] Fix docker-compose image paths --- docker-compose.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index fc30d89f..56614e82 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,13 @@ version: '3' services: client: - image: docker.pkg.github.com/janspeller/bw3-core/client:latest + image: ghcr.io/janspeller/bw3-core/client:latest volumes: - ./config:/opt/boswatch/config + - ./log:/opt/boswatch/log devices: - "/dev/bus/usb" server: - image: docker.pkg.github.com/janspeller/bw3-core/server:latest + image: ghcr.io/janspeller/bw3-core/server:latest volumes: - ./config:/opt/boswatch/config From 04d2a53bcce97c9e4bd85eb92bd313cf234b6b3f Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 23 May 2022 09:09:04 +0000 Subject: [PATCH 19/20] Label images to show them in repository --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 340d73bf..b9ee31a2 100755 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN apk add git && \ FROM python:alpine AS client LABEL maintainer="bastian@schroll-software.de" +LABEL org.opencontainers.image.source=https://github.com/janspeller/BW3-Core # for RTL for MM RUN apk add libusb-dev libpulse @@ -34,6 +35,9 @@ WORKDIR /opt/boswatch CMD python3 /opt/boswatch/bw_client.py -c client.yaml FROM python:alpine AS server +LABEL maintainer="bastian@schroll-software.de"\ +LABEL org.opencontainers.image.source=https://github.com/janspeller/BW3-Core + RUN pip3 install pyyaml COPY --from=boswatch /opt/boswatch/ /opt/boswatch/ WORKDIR /opt/boswatch From fe48da9c63aeb94cdc67056ed9841dff5efc5598 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Mon, 23 May 2022 22:18:16 +0200 Subject: [PATCH 20/20] Change deprecated maintainer label to opencontainers spec and change emails --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9ee31a2..9e9193e8 100755 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apk add git && \ FROM python:alpine AS client -LABEL maintainer="bastian@schroll-software.de" +LABEL org.opencontainers.image.authors="info@schroll-it.de,jan@speller.biz" LABEL org.opencontainers.image.source=https://github.com/janspeller/BW3-Core # for RTL for MM @@ -35,7 +35,7 @@ WORKDIR /opt/boswatch CMD python3 /opt/boswatch/bw_client.py -c client.yaml FROM python:alpine AS server -LABEL maintainer="bastian@schroll-software.de"\ +LABEL org.opencontainers.image.authors="info@schroll-it.de,jan@speller.biz" LABEL org.opencontainers.image.source=https://github.com/janspeller/BW3-Core RUN pip3 install pyyaml