Skip to content

Commit

Permalink
Feat/tonistiigi custom version (#377)
Browse files Browse the repository at this point in the history
* Add parameter binfmt_version

* Add parameter everywhere

* fix syntax
  • Loading branch information
marboledacci authored Feb 18, 2025
1 parent 1b5c555 commit 55c9e8b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/commands/build_and_push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ parameters:
description: >
When true the authentication to docker registry will be done using the ecr-credential-helper. This avoids having
the password saved in plain text. Otherwise it will use the classic docker login command which is more compatible.
binfmt_version:
type: string
default: qemu-v7.0.0-28
description: |
The version to use for binfmt image.
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
See https://hub.docker.com/r/tonistiigi/binfmt for details.
steps:
- when:
condition: <<parameters.checkout>>
Expand Down Expand Up @@ -290,3 +300,4 @@ steps:
public_registry_alias: <<parameters.public_registry_alias>>
build_path: <<parameters.build_path>>
aws_domain: <<parameters.aws_domain>>
binfmt_version: <<parameters.binfmt_version>>
9 changes: 9 additions & 0 deletions src/commands/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ parameters:
The AWS domain for your region, e.g in China, the AWS domain is amazonaws.com.cn
The default value is amazonaws.com
binfmt_version:
type: string
default: qemu-v7.0.0-28
description: |
The version to use for binfmt image.
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
See https://hub.docker.com/r/tonistiigi/binfmt for details.
steps:
- run:
name: Build Docker Image with buildx
Expand All @@ -126,5 +134,6 @@ steps:
AWS_ECR_STR_PUBLIC_REGISTRY_ALIAS: <<parameters.public_registry_alias>>
AWS_ECR_EVAL_BUILD_PATH: <<parameters.build_path>>
AWS_ECR_STR_AWS_DOMAIN: <<parameters.aws_domain>>
PARAM_BINFMT_VERSION: <<parameters.binfmt_version>>
command: <<include(scripts/docker_buildx.sh)>>
no_output_timeout: <<parameters.no_output_timeout>>
10 changes: 10 additions & 0 deletions src/jobs/build_and_push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ parameters:
When true the authentication to docker registry will be done using the ecr-credential-helper. This avoids having
the password saved in plain text. Otherwise it will use the classic docker login command which is more compatible.
binfmt_version:
type: string
default: qemu-v7.0.0-28
description: |
The version to use for binfmt image.
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
See https://hub.docker.com/r/tonistiigi/binfmt for details.
steps:
- build_and_push_image:
account_id: <<parameters.account_id>>
Expand Down Expand Up @@ -259,3 +268,4 @@ steps:
repo_image_tag_mutability: <<parameters.repo_image_tag_mutability>>
use_credentials_helper: <<parameters.use_credentials_helper>>
aws_domain: <<parameters.aws_domain>>
binfmt_version: <<parameters.binfmt_version>>
2 changes: 1 addition & 1 deletion src/scripts/docker_buildx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if [ "${AWS_ECR_BOOL_SKIP_WHEN_TAGS_EXIST}" -eq "0" ] || [[ "${AWS_ECR_BOOL_SKIP
# We need to skip the creation of the builder context if it's already present
# otherwise the command will fail when called more than once in the same job.
docker context create builder
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --privileged --rm "tonistiigi/binfmt:$PARAM_BINFMT_VERSION" --install all
docker --context builder buildx create --name DLC_builder --use
fi
context_args="--context builder"
Expand Down

0 comments on commit 55c9e8b

Please sign in to comment.