Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…mands. 6e29de2 ci: Supply `platform` argument to docker commands. (David Gumberg) Pull request description: I ran into this issue when following the instructions in `ci/README.md` for running CI locally. Newer versions of docker require a `--platform` argument when building from a platform-specific image that differs from the host platform, I'm not sure when this change took place, but trying to build any of the cross-platform CI images on Docker 27.5.0 fails in the following manner: ```console $ # From ci/README.md $ env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh' WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested Creating docker.io/arm64v8/debian:bookworm container to run in + docker build --file $BITCOIN_SRC/ci/test_imagefile --build-arg CI_IMAGE_NAME_TAG=docker.io/arm64v8/debian:bookworm --build-arg FILE_ENV=./ci/test/00_setup_env_arm.sh --label=bitcoin-ci-test --tag=ci_arm_linux $BITCOIN_SRC [+] Building 0.6s (2/2) FINISHED docker:default => [internal] load build definition from test_imagefile 0.0s => => transferring dockerfile: 600B 0.0s => WARN: InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8) 0.0s => ERROR [internal] load metadata for docker.io/arm64v8/debian:bookworm 0.5s ------ > [internal] load metadata for docker.io/arm64v8/debian:bookworm: ------ 1 warning found (use docker --debug to expand): - InvalidDefaultArgInFrom: Default value for ARG ${CI_IMAGE_NAME_TAG} results in empty or invalid base image name (line 8) test_imagefile:8 -------------------- 6 | 7 | ARG CI_IMAGE_NAME_TAG 8 | >>> FROM ${CI_IMAGE_NAME_TAG} 9 | 10 | ARG FILE_ENV -------------------- ERROR: failed to solve: docker.io/arm64v8/debian:bookworm: failed to resolve source metadata for docker.io/arm64v8/debian:bookworm: no match for platform in manifest: not found ``` This branch fixes this by setting the `--platform` argument of `docker build` and `docker run` with an environment variable `CI_IMAGE_PLATFORM` for each platform specific job, and `linux/{$cpuarch}` for any native jobs. Thi ## Steps to reproduce 1. Install relevant dependencies, on Ubuntu: ```bash sudo apt install bash docker.io python3 qemu-user-static ``` 2. Run one of the platform-specific CI images, e.g.: ```bash env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh' ``` ACKs for top commit: maflcko: lgtm ACK 6e29de2 hebasto: ACK 6e29de2 Tree-SHA512: 81b9fa8ec1f3d21619d37d864047c8d7917ef2c8536851f80facf7f1973dfe14628d7755f12d2a9c6edebb6cb16877c582d4d41cdab52b73b23c44f08c6e6b30
- Loading branch information