Skip to content

Commit 55c9e8b

Browse files
authored
Feat/tonistiigi custom version (#377)
* Add parameter binfmt_version * Add parameter everywhere * fix syntax
1 parent 1b5c555 commit 55c9e8b

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

src/commands/build_and_push_image.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ parameters:
217217
description: >
218218
When true the authentication to docker registry will be done using the ecr-credential-helper. This avoids having
219219
the password saved in plain text. Otherwise it will use the classic docker login command which is more compatible.
220+
221+
binfmt_version:
222+
type: string
223+
default: qemu-v7.0.0-28
224+
description: |
225+
The version to use for binfmt image.
226+
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
227+
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
228+
See https://hub.docker.com/r/tonistiigi/binfmt for details.
229+
220230
steps:
221231
- when:
222232
condition: <<parameters.checkout>>
@@ -290,3 +300,4 @@ steps:
290300
public_registry_alias: <<parameters.public_registry_alias>>
291301
build_path: <<parameters.build_path>>
292302
aws_domain: <<parameters.aws_domain>>
303+
binfmt_version: <<parameters.binfmt_version>>

src/commands/build_image.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ parameters:
106106
The AWS domain for your region, e.g in China, the AWS domain is amazonaws.com.cn
107107
The default value is amazonaws.com
108108
109+
binfmt_version:
110+
type: string
111+
default: qemu-v7.0.0-28
112+
description: |
113+
The version to use for binfmt image.
114+
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
115+
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
116+
See https://hub.docker.com/r/tonistiigi/binfmt for details.
109117
steps:
110118
- run:
111119
name: Build Docker Image with buildx
@@ -126,5 +134,6 @@ steps:
126134
AWS_ECR_STR_PUBLIC_REGISTRY_ALIAS: <<parameters.public_registry_alias>>
127135
AWS_ECR_EVAL_BUILD_PATH: <<parameters.build_path>>
128136
AWS_ECR_STR_AWS_DOMAIN: <<parameters.aws_domain>>
137+
PARAM_BINFMT_VERSION: <<parameters.binfmt_version>>
129138
command: <<include(scripts/docker_buildx.sh)>>
130139
no_output_timeout: <<parameters.no_output_timeout>>

src/jobs/build_and_push_image.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,15 @@ parameters:
223223
When true the authentication to docker registry will be done using the ecr-credential-helper. This avoids having
224224
the password saved in plain text. Otherwise it will use the classic docker login command which is more compatible.
225225
226+
binfmt_version:
227+
type: string
228+
default: qemu-v7.0.0-28
229+
description: |
230+
The version to use for binfmt image.
231+
The binfmt image is used to emulate multiple arquitectures when building multiplatform images.
232+
Defaults to qemu-v7.0.0-28, change only if you know what you are doing.
233+
See https://hub.docker.com/r/tonistiigi/binfmt for details.
234+
226235
steps:
227236
- build_and_push_image:
228237
account_id: <<parameters.account_id>>
@@ -259,3 +268,4 @@ steps:
259268
repo_image_tag_mutability: <<parameters.repo_image_tag_mutability>>
260269
use_credentials_helper: <<parameters.use_credentials_helper>>
261270
aws_domain: <<parameters.aws_domain>>
271+
binfmt_version: <<parameters.binfmt_version>>

src/scripts/docker_buildx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if [ "${AWS_ECR_BOOL_SKIP_WHEN_TAGS_EXIST}" -eq "0" ] || [[ "${AWS_ECR_BOOL_SKIP
7979
# We need to skip the creation of the builder context if it's already present
8080
# otherwise the command will fail when called more than once in the same job.
8181
docker context create builder
82-
docker run --privileged --rm tonistiigi/binfmt --install all
82+
docker run --privileged --rm "tonistiigi/binfmt:$PARAM_BINFMT_VERSION" --install all
8383
docker --context builder buildx create --name DLC_builder --use
8484
fi
8585
context_args="--context builder"

0 commit comments

Comments
 (0)