Installation
apt-get update
apt-get -y install docker.io
ln -sf /usr/bin/docker.io /usr/local/bin/docker
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
update-rc.d docker.io defaults
Download a Docker Container
docker pull ubuntu
Run a Docker Container
docker run -i -t ubuntu /bin/bash
List Containers
docker ps
docker ps -a
docker ps -l
Attach to a Specific Container
docker attach 9c09acd48a25
9c09acd48a25
is CONTAINER ID
Commit Changes to Docker
Once you’ve completed those instructions you can disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q
.
docker commit 9c09acd48a25 my_con_01
List images
docker images
View Logs for a Docker Container
docker logs 2c9d5e12800e