Skip to content

Commit f8e4e04

Browse files
committed
feat(justfile): add apt_cache_sharing argument to avoid buildah bug
There are bugs with cache sharing in buildah when using a locked strategy, so avoid doing that on podman by default (overridable).
1 parent d843409 commit f8e4e04

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

justfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ podman_remote := if _docker_bin_name == 'podman' {
2626
'false'
2727
}
2828

29+
# apt cache sharing mode hits a bug in buildah
30+
_apt_cache_sharing := if _docker_bin_name == 'podman' {
31+
''
32+
} else {
33+
',sharing=locked'
34+
}
35+
2936
targets := 'go rust rust-musl tools devcontainer'
3037

3138
load := 'false'
@@ -154,6 +161,7 @@ _build *args='':
154161
--progress='{{ DOCKER_PROGRESS }}' \
155162
{{ output }} \
156163
{{ if docker_arch != '' { '--platform=' + docker_arch } else { '' } }} \
164+
--build-arg APT_CACHE_SHARING={{ _apt_cache_sharing }} \
157165
{{ args }}"
158166

159167
echo "{{ style('error') }}$cmd{{ NORMAL }}"

0 commit comments

Comments
 (0)