Skip to content
Snippets Groups Projects
Commit 45a3d44e authored by jurgenhaas's avatar jurgenhaas
Browse files

#33 Improve reset feature

parent 0fe7c953
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
function cleanup { function cleanup {
NEWIMAGEID=$(docker image ls -q registry.lakedrops.com/docker/l3d/php-${PHP_VERSION}:${VERSION} | head -1) NEWIMAGEID=$(docker image ls -q registry.lakedrops.com/docker/l3d/php-${PHP_VERSION}:${VERSION} | head -1)
while true; do while true; do
IMAGEID=$(docker image ls -q registry.lakedrops.com/docker/l3d/php-${PHP_VERSION} | grep -v ${NEWIMAGEID}) if [[ $L3D_FORCE_UPDATE -eq 1 ]]; then
IMAGEID=$(docker image ls -q registry.lakedrops.com/docker/l3d/php-${PHP_VERSION})
else
IMAGEID=$(docker image ls -q registry.lakedrops.com/docker/l3d/php-${PHP_VERSION} | grep -v ${NEWIMAGEID})
fi
if [[ -n ${IMAGEID} ]]; then if [[ -n ${IMAGEID} ]]; then
while true; do while true; do
ID=$(docker container ls --all -q -f ancestor=${IMAGEID}) ID=$(docker container ls --all -q -f ancestor=${IMAGEID})
...@@ -15,8 +19,10 @@ function cleanup { ...@@ -15,8 +19,10 @@ function cleanup {
break break
fi fi
done done
echo "Removing outdated image ..." if [[ $L3D_FORCE_UPDATE -eq 0 ]]; then
docker rmi ${IMAGEID} >/dev/null echo "Removing outdated image ..."
docker rmi ${IMAGEID} >/dev/null
fi
else else
break break
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment