From db4a74085fbcbbb4fa119ec10d068bbc43f4efb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Nogueira?= Date: Fri, 16 Oct 2020 16:17:34 +0100 Subject: [PATCH 1/7] Make Dockerfile compatible with ARM --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e59a34a9..51566042 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,10 @@ # Copyright (c) 2020 George Hilliard # SPDX-License-Identifier: AGPL-3.0-only -FROM docker.io/rust:1-alpine AS build +FROM docker.io/alpine AS build MAINTAINER thirtythreeforty@gmail.com +RUN apk add rust cargo RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ gst-rtsp-server-dev RUN apk add --no-cache musl-dev gcc @@ -34,7 +35,9 @@ COPY --from=build \ /usr/local/src/neolink/target/release/neolink \ /usr/local/bin/neolink COPY docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh CMD ["/usr/local/bin/neolink", "--config", "/etc/neolink.toml"] ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 8554 +EXPOSE 8554 + From 3f2c9ef41e139e3a7d621fcc4cbd6f851aa1d862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <33097131+JoaoNogueira114@users.noreply.github.com> Date: Mon, 19 Oct 2020 02:36:45 +0100 Subject: [PATCH 2/7] Update docker.yaml --- .github/workflows/docker.yaml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a6393157..52f22488 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -29,12 +29,35 @@ jobs: uses: ASzc/change-string-case-action@v1 with: string: ${{ github.repository }} - - name: Push to Docker Hub - uses: docker/build-push-action@v1 + - name: Set up QEMU if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/setup-buildx-action@v1 + - name: Login to dockerhub + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/login-action@v1 with: username: ${{ steps.string_user.outputs.lowercase }} password: ${{ secrets.DOCKER_TOKEN }} - registry: docker.io - repository: ${{ steps.string_repo.outputs.lowercase }} - tag_with_ref: true + - name: Get tag name + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + id: tags + run: | + branch="${GITHUB_REF#refs/heads/}" + tags="${REPO_NAME}:${branch}" + if [ "${branch}" == "master" ]; then + tags="${tags},${REPO_NAME}:latest" + fi + echo "::set-output name=TAGS::${tags}" + env: + REPO_NAME: ${{ steps.string_repo.outputs.lowercase }} + - name: Push to Docker Hub Debian + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/build-push-action@v2 + with: + platforms: linux/arm/v7,linux/amd64 + push: true + file: Dockerfile + tags: ${{ steps.tags.outputs.TAGS }} From ab266de14820665c98c1d3d8964f65cadd8327b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <33097131+JoaoNogueira114@users.noreply.github.com> Date: Mon, 19 Oct 2020 02:41:30 +0100 Subject: [PATCH 3/7] Update docker.yaml --- .github/workflows/docker.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 52f22488..b481f584 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -35,12 +35,6 @@ jobs: - name: Set up Docker Buildx if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} uses: docker/setup-buildx-action@v1 - - name: Login to dockerhub - if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} - uses: docker/login-action@v1 - with: - username: ${{ steps.string_user.outputs.lowercase }} - password: ${{ secrets.DOCKER_TOKEN }} - name: Get tag name if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} id: tags From 78c60f751fd270bec08d5c76e95fbc9e46778005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Nogueira?= Date: Mon, 19 Oct 2020 13:38:22 +0100 Subject: [PATCH 4/7] Revert "Update docker.yaml" This reverts commit ab266de14820665c98c1d3d8964f65cadd8327b2. --- .github/workflows/docker.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index b481f584..52f22488 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -35,6 +35,12 @@ jobs: - name: Set up Docker Buildx if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} uses: docker/setup-buildx-action@v1 + - name: Login to dockerhub + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/login-action@v1 + with: + username: ${{ steps.string_user.outputs.lowercase }} + password: ${{ secrets.DOCKER_TOKEN }} - name: Get tag name if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} id: tags From 43505b53e4b6931abe64328bf7b32e663bb92ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <33097131+JoaoNogueira114@users.noreply.github.com> Date: Tue, 20 Oct 2020 09:25:53 +0100 Subject: [PATCH 5/7] Add arm build v6 and v8 --- .github/workflows/docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 52f22488..7f07643a 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -57,7 +57,7 @@ jobs: if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} uses: docker/build-push-action@v2 with: - platforms: linux/arm/v7,linux/amd64 + platforms: linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 push: true file: Dockerfile tags: ${{ steps.tags.outputs.TAGS }} From 1527cb69def9dc404529c8a46d043b7114c230b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <33097131+JoaoNogueira114@users.noreply.github.com> Date: Tue, 20 Oct 2020 16:49:10 +0100 Subject: [PATCH 6/7] Update docker.yaml --- .github/workflows/docker.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 7f07643a..48b0371c 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -57,7 +57,23 @@ jobs: if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} uses: docker/build-push-action@v2 with: - platforms: linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 + platforms: linux/arm/v6 + push: true + file: Dockerfile + tags: ${{ steps.tags.outputs.TAGS }} + - name: Push to Docker Hub Debian + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/build-push-action@v2 + with: + platforms: linux/arm64/v8 + push: true + file: Dockerfile + tags: ${{ steps.tags.outputs.TAGS }} + - name: Push to Docker Hub Debian + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/build-push-action@v2 + with: + platforms: linux/arm/v7,linux/amd64 push: true file: Dockerfile tags: ${{ steps.tags.outputs.TAGS }} From 0693e440313ea90f61c1eb916dc34f820237938b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Nogueira?= Date: Tue, 20 Oct 2020 23:40:38 +0100 Subject: [PATCH 7/7] Split arm-v6 --- .github/workflows/docker-arm-v6.yaml | 63 ++++++++++++++++++++++++++++ .github/workflows/docker.yaml | 18 +------- 2 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/docker-arm-v6.yaml diff --git a/.github/workflows/docker-arm-v6.yaml b/.github/workflows/docker-arm-v6.yaml new file mode 100644 index 00000000..07c6149d --- /dev/null +++ b/.github/workflows/docker-arm-v6.yaml @@ -0,0 +1,63 @@ +# A single-shot build-n-pack on Alpine Linux +name: Publish Docker image (ARM v6) +on: [push] + +jobs: + push_to_registry: + name: Build Docker image (ARM v6) + runs-on: ubuntu-latest + steps: + - name: Check token is set + id: vars + shell: bash + run: | + unset HAS_SECRET + if [ -n $SECRET ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET_TOKEN::${HAS_SECRET} + env: + SECRET: "${{ secrets.DOCKER_TOKEN }}" + - name: Check out the repo + uses: actions/checkout@v2 + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + - name: Convert username to lower case for docker + id: string_user + uses: ASzc/change-string-case-action@v1 + with: + string: ${{ github.repository_owner }} + - name: Convert repo to lower case for docker + id: string_repo + uses: ASzc/change-string-case-action@v1 + with: + string: ${{ github.repository }} + - name: Set up QEMU + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/setup-buildx-action@v1 + - name: Login to dockerhub + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/login-action@v1 + with: + username: ${{ steps.string_user.outputs.lowercase }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: Get tag name + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + id: tags + run: | + branch="${GITHUB_REF#refs/heads/}" + tags="${REPO_NAME}:${branch}" + if [ "${branch}" == "master" ]; then + tags="${tags},${REPO_NAME}:latest" + fi + echo "::set-output name=TAGS::${tags}" + env: + REPO_NAME: ${{ steps.string_repo.outputs.lowercase }} + - name: Push to Docker Hub Debian + if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} + uses: docker/build-push-action@v2 + with: + platforms: linux/arm/v6 + push: true + file: Dockerfile + tags: ${{ steps.tags.outputs.TAGS }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 48b0371c..668d706b 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -57,23 +57,7 @@ jobs: if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} uses: docker/build-push-action@v2 with: - platforms: linux/arm/v6 - push: true - file: Dockerfile - tags: ${{ steps.tags.outputs.TAGS }} - - name: Push to Docker Hub Debian - if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} - uses: docker/build-push-action@v2 - with: - platforms: linux/arm64/v8 - push: true - file: Dockerfile - tags: ${{ steps.tags.outputs.TAGS }} - - name: Push to Docker Hub Debian - if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} - uses: docker/build-push-action@v2 - with: - platforms: linux/arm/v7,linux/amd64 + platforms: linux/arm/v7,linux/arm64/v8,linux/amd64 push: true file: Dockerfile tags: ${{ steps.tags.outputs.TAGS }}