Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Last active August 29, 2015 14:06
Show Gist options
  • Save v-thomp4/bb80d5e0311b605a63f3 to your computer and use it in GitHub Desktop.
Save v-thomp4/bb80d5e0311b605a63f3 to your computer and use it in GitHub Desktop.
docker command

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment