Docker Hub

Install docker

wget -qO- >
sh ./

Start docker

service docker start

Test docker

docker run hello-world

Run commands from container

docker run ubuntu:14.04 echo "hello world"
docker run ubuntu:14.04 ps ax

Run container and connect to shell

docker run -i -t ubuntu:14.04 /bin/bash
NOTE: [cntl+p+q] leaves the shell but keeps the container running.
docker attach <containerid>   [connect to running container]

List containers

docker ps       [lists running containers]
docker ps -a    [lists all containers]

Run container and view standard out

docker run -d centos:7 ping -c 50
docker logs <centos containerid>
docker logs -f <centos containerid>   [similar to tail -f]

Run web application container with ports

docker run -d -P tomcat:7
docker ps    [use this to see port mappings]
  • docker/introduction.txt
  • Last modified: 2018/05/25 13:05
  • (external edit)