mirror of
https://github.com/ceph/ceph
synced 2025-03-22 18:27:10 +00:00
script/build-with-container: skip dnf cache dir volume mounts on docker
When using docker the --volume option is not available during build
(docker [buildx] build), unlike podman. Since passing these volumes must
be conditional on them being set up I see no way to handle this short of
just disabling the option on docker. Log the fact that it's being
skipped - the only other issue is that we pointlessly set up some dirs
and the build may be a bit slower.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 4208a73665
)
This commit is contained in:
parent
e56df19133
commit
08f7626d72
@ -425,7 +425,11 @@ def build_container(ctx):
|
||||
]
|
||||
if ctx.cli.distro:
|
||||
cmd.append(f"--build-arg=DISTRO={ctx.from_image}")
|
||||
if ctx.dnf_cache_dir:
|
||||
if ctx.dnf_cache_dir and "docker" in ctx.container_engine:
|
||||
log.warning(
|
||||
"The --volume option is not supported by docker. Skipping dnf cache dir mounts"
|
||||
)
|
||||
elif ctx.dnf_cache_dir:
|
||||
cmd += [
|
||||
f"--volume={ctx.dnf_cache_dir}/lib:/var/lib/dnf:Z",
|
||||
f"--volume={ctx.dnf_cache_dir}:/var/cache/dnf:Z",
|
||||
|
Loading…
Reference in New Issue
Block a user