Browse Source

remove temporary container

www
Fernando Alegre 7 months ago
parent
commit
a86e5d80e9
  1. 11
      .install/bin/pdm-build

11
.install/bin/pdm-build

@ -39,7 +39,6 @@ as the image name.
Options: Options:
-d Debug mode: don't delete the temporary container created by the script -d Debug mode: don't delete the temporary container created by the script
when encountering an error
-r Redo build from scratch instead of using cached layers -r Redo build from scratch instead of using cached layers
-s Squash all layers in the image into a single layer -s Squash all layers in the image into a single layer
-t tag Tag the image with the given string. Can be used multiple times to assign -t tag Tag the image with the given string. Can be used multiple times to assign
@ -127,6 +126,10 @@ if [[ -f Initfile ]]; then
podman exec tmp-$epoch bash -c "chmod +x /root/Initfile && /root/Initfile" podman exec tmp-$epoch bash -c "chmod +x /root/Initfile && /root/Initfile"
echo "Committing container tmp-$epoch to image $name:$today ..." echo "Committing container tmp-$epoch to image $name:$today ..."
podman commit tmp-$epoch "$name:$today" podman commit tmp-$epoch "$name:$today"
if [[ $opt_debug -eq 0 ]]; then
echo "Removing temporary container tmp-$epoch ..."
podman rm -i -f tmp-$epoch
fi
else else
echo "Initfile not found, skipping temporary container step ..." echo "Initfile not found, skipping temporary container step ..."
# tag image we already built with appropriate tag, and untag with tmp # tag image we already built with appropriate tag, and untag with tmp
@ -134,8 +137,10 @@ else
podman tag tmp-$epoch "$name:$today" podman tag tmp-$epoch "$name:$today"
fi fi
echo "Removing temporary image tmp-$epoch ..." if ! podman container exists tmp-$epoch ; then
podman rmi tmp-$epoch echo "Removing temporary image tmp-$epoch ..."
podman rmi tmp-$epoch
fi
# tag image as latest # tag image as latest
echo "Adding latest tag to image $name:$today ..." echo "Adding latest tag to image $name:$today ..."

Loading…
Cancel
Save