🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix: use target platform to build final image (#3397)
Deluan Quintão00c6a0ed1f3c
diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.ymlindex 9fb40ef27..693fc6441 100644--- a/.github/workflows/pipeline.yml+++ b/.github/workflows/pipeline.yml@@ -173,6 +173,7 @@ jobs:runs-on: ubuntu-latestenv:IS_LINUX: ${{ startsWith(matrix.platform, 'linux/') && 'true' || 'false' }}+ IS_ARMV5: ${{ matrix.platform == 'linux/arm/v5' && 'true' || 'false' }}IS_DOCKER_PUSH_CONFIGURED: ${{ needs.check-push-enabled.outputs.is_enabled == 'true' }}DOCKER_BUILD_SUMMARY: falseGIT_SHA: ${{ needs.git-version.outputs.git_sha }}@@ -219,7 +220,7 @@ jobs:# https://www.perplexity.ai/search/can-i-have-multiple-push-to-di-4P3ToaZFQtmVROuhaZMllQ- name: Build and push image by digestid: push-image- if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true'+ if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'uses: docker/build-push-action@v6with:context: .@@ -235,7 +236,7 @@ jobs:type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true- name: Export digest- if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true'+ if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'run: |mkdir -p /tmp/digestsdigest="${{ steps.push-image.outputs.digest }}"@@ -243,7 +244,7 @@ jobs:- name: Upload digestuses: actions/upload-artifact@v4- if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true'+ if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'with:name: digests-${{ env.PLATFORM }}path: /tmp/digests/*diff --git a/Dockerfile b/Dockerfileindex 2ecb35a26..53934ca1d 100644--- a/Dockerfile+++ b/Dockerfile@@ -118,7 +118,7 @@ COPY --from=build /out /########################################################################################################################### Build Final Image-FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/alpine:3.20 AS final+FROM public.ecr.aws/docker/library/alpine:3.20 AS finalLABEL maintainer="[email protected]"# Install ffmpeg and mpvdiff --git a/Makefile b/Makefileindex 1399aea32..47e9d9376 100644--- a/Makefile+++ b/Makefile@@ -10,7 +10,7 @@ GIT_TAG=$(patsubst navidrome-%,v%,$(notdir $(PWD)))-SNAPSHOTendifSUPPORTED_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,linux/386,darwin/amd64,darwin/arm64,windows/amd64,windows/386-IMAGE_PLATFORMS ?= $(shell echo $(SUPPORTED_PLATFORMS) | tr ',' '\n' | grep "linux" | tr '\n' ',' | sed 's/,$$//')+IMAGE_PLATFORMS ?= $(shell echo $(SUPPORTED_PLATFORMS) | tr ',' '\n' | grep "linux" | grep -v "arm/v5" | tr '\n' ',' | sed 's/,$$//')PLATFORMS ?= $(SUPPORTED_PLATFORMS)DOCKER_TAG ?= deluan/navidrome:develop@@ -126,6 +126,7 @@ docker-build: ##@Cross_Compilation Cross-compile for any supported platform (chedocker-image: ##@Cross_Compilation Build Docker image, tagged as `deluan/navidrome:develop`, override with DOCKER_TAG var. Use IMAGE_PLATFORMS to specify target platforms@echo $(IMAGE_PLATFORMS) | grep -q "windows" && echo "ERROR: Windows is not supported for Docker builds" && exit 1 || true@echo $(IMAGE_PLATFORMS) | grep -q "darwin" && echo "ERROR: macOS is not supported for Docker builds" && exit 1 || true+ @echo $(IMAGE_PLATFORMS) | grep -q "arm/v5" && echo "ERROR: Linux ARMv5 is not supported for Docker builds" && exit 1 || truedocker build \--platform $(IMAGE_PLATFORMS) \--build-arg GIT_TAG=${GIT_TAG} \