Update remove_container

This commit is contained in:
lunardunno 2025-03-19 13:45:32 +04:00 committed by GitHub
parent bf65a57b32
commit 8d2a4990e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,9 @@
sudo docker stop $CONTAINER_NAME;\
sudo docker --version 2>/dev/null | grep -q podman && \
sudo systemctl disable --now container-$CONTAINER_NAME.service && \
sudo systemctl daemon-reload && sudo systemctl reset-failed && \
sudo rm -f /etc/systemd/system/container-$CONTAINER_NAME.service && \
if [ -n "$(sudo docker --version 2>/dev/null | grep podman)" ]; then \
sudo systemctl disable --now container-$CONTAINER_NAME.service;\
sudo systemctl daemon-reload; sudo systemctl reset-failed;\
sudo rm -f /etc/systemd/system/container-$CONTAINER_NAME.service;\
sudo systemctl daemon-reload;\
fi;\
sudo docker rm -fv $CONTAINER_NAME;\
sudo docker rmi $CONTAINER_NAME