Repository navigation
Fix Docker buildx action - #2706
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the CI/CD workflow to accommodate docker/setup-buildx-action@v4.0.0 where the docker build alias behavior changed/was removed.
Changes:
- Replaces some
docker build --pushusages withdocker buildx ...in the workflow-generated command strings. - Updates the deployment image build command to use
docker buildx .... - Removes
install: truefrom the buildx setup step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ -n "$MANAGER_TAGS" ] || [[ "$DEPLOYMENTS" == *"#ref"* ]] || [ -n "$TEST_UI_CMD" ]; then | ||
| if [ -n "$MANAGER_TAGS" ]; then | ||
| command="docker build --push --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 $MANAGER_TAGS $buildPath && docker build --build-arg GIT_COMMIT=$commitSha --platform ${PLATFORM:-linux/amd64} --load -t openremote/manager:$commitShaShort $buildPath" | ||
| command="docker buildx --push --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 $MANAGER_TAGS $buildPath && docker build --build-arg GIT_COMMIT=$commitSha --platform ${PLATFORM:-linux/amd64} --load -t openremote/manager:$commitShaShort $buildPath" |
There was a problem hiding this comment.
docker buildx requires a subcommand (e.g., build). As written, docker buildx --push ... will fail because --push is a flag for docker buildx build, not for the top-level docker buildx command. Also, the second chained command still uses docker build ... --load, but --load is a buildx-only flag; if the docker build alias was removed, this will also fail. Update both chained builds to use docker buildx build (with --push / --load as needed).
| command="docker buildx --push --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 -t ${{ steps.inputs-and-secrets.outputs.OR_AWS_DEVELOPERS_ACCOUNT_ID }}.dkr.ecr.eu-west-1.amazonaws.com/openremote/manager:SNAPSHOT-$commitShaShort $buildPath && docker build --build-arg GIT_COMMIT=$commitSha --platform ${PLATFORM:-linux/amd64} --load -t openremote/manager:$commitShaShort $buildPath" | ||
| else | ||
| command="docker build --build-arg GIT_COMMIT=$commitSha --platform ${PLATFORM:-linux/amd64} --load -t openremote/manager:$commitShaShort $buildPath && docker build --build-arg GIT_COMMIT=$commitSha --platform ${OTHER_PLATFORM:-linux/aarch64} -t openremote/manager:$commitShaShort $buildPath" |
There was a problem hiding this comment.
Same issue here: docker buildx --push ... is missing the build subcommand, and the chained docker build ... --load will fail if docker build is no longer aliased to buildx. Additionally, the non-snapshot branch below still uses docker build ... --load (and another docker build with --platform) which likely relied on that alias too. Consider switching all docker build invocations in this step that use buildx-only flags (--load / --push) to docker buildx build for consistency and to avoid runtime failures.
|
|
||
| if [ -n "$DEPLOYMENTS" ]; then | ||
| command="docker build --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 -t openremote/deployment:$commitShaShort $buildPath" | ||
| command="docker buildx --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 -t openremote/deployment:$commitShaShort $buildPath" |
There was a problem hiding this comment.
docker buildx is missing the build subcommand here as well; docker buildx --build-arg ... will be rejected because flags are parsed on docker buildx build. Change this to docker buildx build .... Also verify the intended output: with buildx, a multi-platform build without --push or --load/--output won’t produce a locally tagged image, so if later steps expect openremote/deployment:$commitShaShort to exist, you’ll need --push or a single-platform --load/--output.
| command="docker buildx --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 -t openremote/deployment:$commitShaShort $buildPath" | |
| command="docker buildx build --build-arg GIT_COMMIT=$commitSha --platform linux/amd64,linux/aarch64 -t openremote/deployment:$commitShaShort $buildPath" |
|



The
installparameter which configures an alias fordocker buildwas removed in version v3.12.0 of thedocker/setup-buildx-actionaction(Ref: docker/setup-buildx-action#455)