allow passing arbitrary build options in containerfile element

Change-Id: I864030c3f48fa907dfe088cd7aa1288dd82e472e
This commit is contained in:
Steve Brasier 2022-11-02 16:55:53 +00:00
parent 4ff8721a66
commit be4608a546
2 changed files with 3 additions and 1 deletions

View File

@ -22,3 +22,5 @@ Set ``DIB_CONTAINERFILE_RUNTIME_ROOT`` to ``1`` to run the runtime
Set ``DIB_CONTAINERFILE_NETWORK_DRIVER`` to a network driver of your choice
(e.g. host) to use it instead of the default bridge during build.
Set ``DIB_CONTAINERFILE_BUILDOPTS`` to pass any other options to build command, e.g. ``--from docker.io/library/ubuntu:jammy --build-arg=HTTP_PROXY=http://10.20.30.2:1234``

View File

@ -88,7 +88,7 @@ function podman_cleanup() {
trap "podman_cleanup" EXIT
${_sudo} ${DIB_CONTAINERFILE_RUNTIME} build ${DIB_CONTAINERFILE_RUNTIME_NETWORK} -t ${_podman_build_image} -f $DIB_CONTAINERFILE_DOCKERFILE $DIB_CONTAINER_CONTEXT
${_sudo} ${DIB_CONTAINERFILE_RUNTIME} build ${DIB_CONTAINERFILE_RUNTIME_NETWORK} -t ${_podman_build_image} -f $DIB_CONTAINERFILE_DOCKERFILE ${DIB_CONTAINERFILE_BUILDOPTS:-} $DIB_CONTAINER_CONTEXT
${_sudo} ${DIB_CONTAINERFILE_RUNTIME} run ${DIB_CONTAINERFILE_RUNTIME_NETWORK} --name ${_podman_export_container} -d ${_podman_build_image} /bin/sh
# NOTE(ianw) 2021-11-10 the tar must always be sudo to write out the chroot files
# as other uids