docker container run

docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]

https://docs.docker.com/engine/reference/commandline/container_run/

 

Options:

-d => detached

--rm =>Automatically remove the container when it exits

 

Examples:

docker container run -d alpine sleep 1d

docker container run --rm -d --network london alpine sleep 1d

 

Potential problems:

docker: Error response from daemon: Conflict. The container name “<name>” is already in use by container “<container id>”. You have to remove (or rename) that container to be able to reuse that name.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *