Check for running containers:
docker ps
If any exist, remove them:
docker rm -f $(docker ps -aq)
Run a container:
-rmno_restartbusybox1docker run -d \
--name no_restart \
busybox sh -c "sleep 3 && exit 1"
Check immediately:
docker ps
The container should appear as running.
Wait 3 seconds and check again:
docker ps