Docker Containers

Containers

Create

Start

docker start mycontainer

Stop

docker container stop mycontainer

Remove

docker container rm mycontainer

docker rmi mycontainer

Using Containers

docker exec -it mycontainer bash

Run bash in mycontainer

docker attach mycontainer

To detach use [Ctrl-p][Ctrl-q]
If you attach to a Linux container like Alpine then this command will get you to a root command prompt. If you do the same for something like the official MySQL container then you will not attach to a usable shell.

Bibliography