For example once I create a container with name of "duplo":
docker run --name="duplo" -it /bin/bash -c "sudo /build/backup.sh"
.
How do I execute an additional command within the container after it exits? I can see it listed by docker ps -a
.
For example once I create a container with name of "duplo":
docker run --name="duplo" -it /bin/bash -c "sudo /build/backup.sh"
.
How do I execute an additional command within the container after it exits? I can see it listed by docker ps -a
.
docker start
is the command I was looking for.
docker start -ia duplo
As long as it is stopped, you can do nothing.
Maybe you can start it
https://docs.docker.com/engine/reference/commandline/start/
see the doc
and if it says running, you can connect and launch some commands using
docker exec -it duplo bash
or maybe just modify a string in a file
docker exec -it duplo sed...
, see the associated doc