From 831b5139c1adaf235a64aa7af324ea3ba256b5b8 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 27 Jun 2026 18:21:42 +0100 Subject: [PATCH] ci: pass --target build-env to docker build in APK workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the Dockerfile refactor into multi-stage (commit 6f975f87), 'docker build .' without --target selects the LAST stage of the Dockerfile — which is blogs-runtime, an ASP.NET image with no APK to extract. The subsequent docker cp command then fails with: Error: No such container:path: …PostIt.Android/bin/Release/ net10.0-android/android-arm64/com.CompanyName.PostIt-Signed.apk Add --target build-env to scope the build to the build-env stage (the one that produces both the .apk and the publish artifacts, and which still ends with CMD ["bash"]). --- .github/workflows/docker-publish-android.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-android.yml b/.github/workflows/docker-publish-android.yml index c3723f0a..25c3aa2d 100644 --- a/.github/workflows/docker-publish-android.yml +++ b/.github/workflows/docker-publish-android.yml @@ -14,8 +14,12 @@ jobs: uses: actions/checkout@v7 # 1. Votre étape de build actuelle (on nomme l'image "postit-android") + # --target build-env : on ne veut que le stage de build (qui + # contient les artefacts .apk). Sans --target, Docker ciblerait + # le DERNIER stage du Dockerfile (blogs-runtime, qui est une + # image ASP.NET runtime sans aucun APK à extraire). - name: Build de l'image Docker - run: docker build --build-arg ANDROID_TARGET_RID=android-arm64 -t postit-android . + run: docker build --build-arg ANDROID_TARGET_RID=android-arm64 --target build-env -t postit-android . # 2. EXTRACTION : Créer un conteneur éphémère pour copier l'APK vers l'hôte GitHub - name: Extraire l'APK du conteneur Docker run: |