From 3c969842f70bc79c285fe7b5aa6e3707438c8bee Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 1 Apr 2022 15:46:15 +0100 Subject: [PATCH 1/4] Use v6 actions --- .github/workflows/call-baseimage-update.yml | 2 +- .github/workflows/call-build-image.yml | 2 +- .github/workflows/call-check-and-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/call-baseimage-update.yml b/.github/workflows/call-baseimage-update.yml index b7770ca..d1a0eaa 100644 --- a/.github/workflows/call-baseimage-update.yml +++ b/.github/workflows/call-baseimage-update.yml @@ -6,7 +6,7 @@ on: jobs: call-workflow: - uses: thespad/actions/.github/workflows/check-baseimage-update.yml@v5.1.0 + uses: thespad/actions/.github/workflows/check-baseimage-update.yml@v6 with: repo_owner: ${{ github.repository_owner }} baseimage: "alpine" diff --git a/.github/workflows/call-build-image.yml b/.github/workflows/call-build-image.yml index 06f310b..d02784b 100644 --- a/.github/workflows/call-build-image.yml +++ b/.github/workflows/call-build-image.yml @@ -7,7 +7,7 @@ on: jobs: call-workflow: - uses: thespad/actions/.github/workflows/build-image.yml@v5.1.0 + uses: thespad/actions/.github/workflows/build-image.yml@v6 with: repo_owner: ${{ github.repository_owner }} app_name: "whisparr" diff --git a/.github/workflows/call-check-and-release.yml b/.github/workflows/call-check-and-release.yml index 2832584..e654458 100644 --- a/.github/workflows/call-check-and-release.yml +++ b/.github/workflows/call-check-and-release.yml @@ -7,7 +7,7 @@ on: jobs: call-workflow: - uses: thespad/actions/.github/workflows/check-and-release.yml@v5.1.0 + uses: thespad/actions/.github/workflows/check-and-release.yml@v6 with: repo_owner: ${{ github.repository_owner }} app_name: "whisparr" From 3355af70622d5e97bdecd28a2683a9fcc9cc518f Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 1 Apr 2022 15:48:10 +0100 Subject: [PATCH 2/4] Use separate arch dockerfiles --- Dockerfile.aarch64 | 45 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile.armhf | 45 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++-- docker-bake.hcl | 28 +++++++++++++++++++++++++++- 4 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.aarch64 create mode 100644 Dockerfile.armhf diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 0000000..a544fd0 --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,45 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:3.15 + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG APP_VERSION +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thespad" + +# environment settings +ARG APP_BRANCH="nightly" +ENV XDG_CONFIG_HOME="/config/xdg" + +RUN \ + echo "**** install packages ****" && \ + apk add -U --upgrade --no-cache \ + curl \ + jq \ + icu-libs \ + sqlite-libs && \ + echo "**** install whisparr ****" && \ + mkdir -p /app/whisparr/bin && \ + if [ -z ${APP_VERSION+x} ]; then \ + APP_VERSION=$(curl -sL "https://whisparr.servarr.com/v1/update/${APP_BRANCH}/changes?runtime=netcore&os=linuxmusl" \ + | jq -r '.[0].version'); \ + fi && \ + curl -o \ + /tmp/whisparr.tar.gz -L \ + "https://whisparr.servarr.com/v1/update/${APP_BRANCH}/updatefile?version=${APP_VERSION}&os=linuxmusl&runtime=netcore&arch=arm64" && \ + tar xzf \ + /tmp/whisparr.tar.gz -C \ + /app/whisparr/bin --strip-components=1 && \ + echo -e "UpdateMethod=docker\nBranch=${APP_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[thespad](https://github.com/thespad)" > /app/whisparr/package_info && \ + echo "**** cleanup ****" && \ + rm -rf \ + /app/whisparr/bin/Whisparr.Update \ + /tmp/* \ + /var/tmp/* + +# copy local files +COPY root/ / + +# ports and volumes +EXPOSE 6969 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 0000000..25c732b --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,45 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:3.15 + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG APP_VERSION +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thespad" + +# environment settings +ARG APP_BRANCH="nightly" +ENV XDG_CONFIG_HOME="/config/xdg" + +RUN \ + echo "**** install packages ****" && \ + apk add -U --upgrade --no-cache \ + curl \ + jq \ + icu-libs \ + sqlite-libs && \ + echo "**** install whisparr ****" && \ + mkdir -p /app/whisparr/bin && \ + if [ -z ${APP_VERSION+x} ]; then \ + APP_VERSION=$(curl -sL "https://whisparr.servarr.com/v1/update/${APP_BRANCH}/changes?runtime=netcore&os=linuxmusl" \ + | jq -r '.[0].version'); \ + fi && \ + curl -o \ + /tmp/whisparr.tar.gz -L \ + "https://whisparr.servarr.com/v1/update/${APP_BRANCH}/updatefile?version=${APP_VERSION}&os=linuxmusl&runtime=netcore&arch=arm" && \ + tar xzf \ + /tmp/whisparr.tar.gz -C \ + /app/whisparr/bin --strip-components=1 && \ + echo -e "UpdateMethod=docker\nBranch=${APP_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[thespad](https://github.com/thespad)" > /app/whisparr/package_info && \ + echo "**** cleanup ****" && \ + rm -rf \ + /app/whisparr/bin/Whisparr.Update \ + /tmp/* \ + /var/tmp/* + +# copy local files +COPY root/ / + +# ports and volumes +EXPOSE 6969 +VOLUME /config diff --git a/README.md b/README.md index 082fa1e..0fcdad9 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ The architectures supported by this image are: | Architecture | Available | Tag | | :----: | :----: | ---- | | x86-64 | ✅ | latest | -| arm64 | ❌ | latest | -| armhf | ❌ | latest | +| arm64 | ✅ | latest | +| armhf | ✅ | latest | ## Versions diff --git a/docker-bake.hcl b/docker-bake.hcl index c318484..1baa42f 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -13,9 +13,35 @@ target "image-local" { output = ["type=docker"] } -target "image-all" { +target "amd64" { inherits = ["image"] + dockerfile = "Dockerfile" platforms = [ "linux/amd64" ] } + +target "aarch64" { + inherits = ["image"] + dockerfile = "Dockerfile.aarch64" + platforms = [ + "linux/arm64" + ] +} + +target "armhf" { + inherits = ["image"] + dockerfile = "Dockerfile.armhf" + platforms = [ + "linux/arm/v7" + ] +} + +target "all" { + inherits = ["image"] + platforms = [ + "linux/amd64", + "linux/arm64", + "linux/arm/v7" + ] +} From 15f1f7d48f85b1f27fd620359b865d1df250bfd7 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 1 Apr 2022 15:54:01 +0100 Subject: [PATCH 3/4] Set target-arch --- .github/workflows/call-build-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/call-build-image.yml b/.github/workflows/call-build-image.yml index d02784b..61a804c 100644 --- a/.github/workflows/call-build-image.yml +++ b/.github/workflows/call-build-image.yml @@ -13,5 +13,6 @@ jobs: app_name: "whisparr" release_type: "script" dockerhub_user: "thespad" + target-arch: "amd64,aarch64,armhf" secrets: dockerhub_password: ${{ secrets.DOCKER_PASSWORD }} From f9b2b4a2851a0c16675e263560fe2a01f3152a32 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 1 Apr 2022 16:00:10 +0100 Subject: [PATCH 4/4] Add 64 target --- docker-bake.hcl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index 1baa42f..6591d68 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -37,6 +37,14 @@ target "armhf" { ] } +target "64" { + inherits = ["image"] + platforms = [ + "linux/amd64", + "linux/arm64" + ] +} + target "all" { inherits = ["image"] platforms = [