Skip to content

Commit 311be4c

Browse files
committed
feat(justfile): support specifying architecture via docker_arch
1 parent 0d1b3d6 commit 311be4c

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 *args='': && _list-if-load
3537
just output='{{ output }}' \
3638
image='{{ image }}' \
3739
version='{{ _version }}' \
40+
docker_arch='{{ docker_arch }}' \
3841
_target "$tgt" \
3942
{{ args }}
4043
done
@@ -110,6 +113,7 @@ _target target='' *args='':
110113
output='{{ output }}' \
111114
image='{{ image }}' \
112115
version='{{ _version }}' \
116+
docker_arch='{{ docker_arch }}' \
113117
_build --target='{{ target }}' \
114118
{{ if _version == '' { '' } else { '--tag=' + image + ':' + _version + if target == 'devcontainer' { '' } else { '-' + target } } }} \
115119
{{ args }}
@@ -119,6 +123,7 @@ _build *args='':
119123
docker buildx build . {{ _tag }} --pull \
120124
--progress='{{ DOCKER_PROGRESS }}' \
121125
--output='{{ output }}' \
126+
{{ if docker_arch != '' { '--platform=' + docker_arch } else { '' } }} \
122127
{{ args }}
123128

124129

0 commit comments

Comments
 (0)