Skip to content

Commit e20e85e

Browse files
committed
feat(justfile): support specifying architecture via docker_arch
1 parent 72610e9 commit e20e85e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ _tag := if _version != '' { "--tag=" + image + ':' + _version } else { "" }
1212

1313
k3s-image := 'docker.io/rancher/k3s'
1414

15+
docker_arch := ''
16+
1517
targets := 'go rust rust-musl tools devcontainer'
1618

1719
load := 'false'
@@ -35,6 +37,7 @@ build: && _list-if-load
3537
just output='{{ output }}' \
3638
image='{{ image }}' \
3739
version='{{ _version }}' \
40+
docker_arch='{{ docker_arch }}' \
3841
_target "$tgt"
3942
done
4043

@@ -109,6 +112,7 @@ _target target='':
109112
output='{{ output }}' \
110113
image='{{ image }}' \
111114
version='{{ _version }}' \
115+
docker_arch='{{ docker_arch }}' \
112116
_build --target='{{ target }}' \
113117
{{ if _version == '' { '' } else { '--tag=' + image + ':' + _version + if target == 'devcontainer' { '' } else { '-' + target } } }}
114118

@@ -117,6 +121,7 @@ _build *args='':
117121
docker buildx build . {{ _tag }} --pull \
118122
--progress='{{ DOCKER_PROGRESS }}' \
119123
--output='{{ output }}' \
124+
{{ if docker_arch != '' { '--platform=' + docker_arch } else { '' } }} \
120125
{{ args }}
121126

122127

0 commit comments

Comments
 (0)