mirror of
https://github.com/sameersbn/docker-browser-box
synced 2024-11-16 21:28:05 +00:00
scripts: remove stopped containers
This commit is contained in:
parent
89a7bf7f80
commit
a7eeff107e
@ -11,6 +11,19 @@ else
|
||||
USER_UID=$(id -u)
|
||||
USER_GID=$(id -g)
|
||||
|
||||
# remove stopped containers
|
||||
echo "Removing stopped containers..."
|
||||
for c in $(docker ps -a -q)
|
||||
do
|
||||
image="$(docker inspect -f {{.Config.Image}} ${c})"
|
||||
if [ "${image}" == "sameersbn/browser-bundle:latest" ]; then
|
||||
running=$(docker inspect -f {{.State.Running}} ${c})
|
||||
if [ "${running}" != "true" ]; then
|
||||
docker rm "${c}" >/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
docker run -d \
|
||||
--env="USER_UID=${USER_UID}" \
|
||||
--env="USER_GID=${USER_GID}" \
|
||||
|
Loading…
Reference in New Issue
Block a user