0
Stop a docker container
One script reply has been approved by the moderators Verified

Stops a container of your choice

Created by yassinsiouda74165 316 days ago Viewed 4353 times
0
Submitted by yassinsiouda74165 Bash
Verified 316 days ago
1
name="${1:-my_container}"
2

3
# Stop the container if it is running
4
docker stop "$name" 2>/dev/null || true
5