-
Mac: Install via homebrew
$ brew install docker
-
Linux: Install via apt
$ sudo apt update && sudo apt install docker-io
-
Create the
dockeruser group$ sudo groupadd docker
-
Add current user to the
dockergroup$ sudo usermod -aG docker $USER -
Log out and log back in so that your group membership is re-evaluated.
$ sudo systemctl enable dockerdocker run -it --name $Name_of_the_container ubuntu /bin/bash-
Leave and stop the container
$ exit -
Leave without stopping the container
Ctrl + P & Ctrl + Q
-
Restart an exited container
docker start #CONTAINER_ID -
Attach to the container
docker attach #CONTAINER_ID