Skip to content

Commit 5ce7b0b

Browse files
committed
fix(cd): force remove container
1 parent 131e668 commit 5ce7b0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docker_auto_start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ stop_and_remove() {
2222
echo "Stopping the current container for $image_tag"
2323
CURRENT_CONTAINER=$(docker ps -q -f ancestor=$image_tag)
2424
if [ -n "$CURRENT_CONTAINER" ]; then
25-
docker stop $CURRENT_CONTAINER
25+
docker stop $CURRENT_CONTAINER -f
2626
echo "Removing the current container for $CURRENT_CONTAINER"
27-
docker rm $CURRENT_CONTAINER
27+
docker rm $CURRENT_CONTAINER -f
2828
else
2929
echo "No running container found for $REPO."
3030
fi
@@ -50,7 +50,7 @@ pull_and_start() {
5050
}
5151

5252
# Main function to handle command-line arguments
53-
function main() {
53+
main() {
5454
case "$1" in
5555
stop)
5656
stop_and_remove

0 commit comments

Comments
 (0)