Installation
Officially recommended in Ubuntu installation, this article chooses the ubuntu14.04 as the host system.
System Update
Copy Code code as follows:
sudo apt-get update && apt-get upgrade-y
sudo reboot #最好重启一下
Install Docker
Copy Code code as follows:
Curl-s https://get.docker.io/ubuntu/| sudo sh
Basic command
Copy Code code as follows:
# download an Ubuntu image
sudo docker pull Ubuntu
Copy Code code as follows:
# Run an interactive shell using Ubuntu,
# Assign a pseudo terminal with stdin and stdout (input/output stream)
# If you want to quit the pseudo terminals that are separated,
# You can use Ctrl-p+ctrl-q--just like press ctrl-p and then ctrl-q
sudo docker run-i-T Ubuntu/bin/bash
-H can also authorize TCP bindings in a short way: host[:p ort] or:p ORT
Copy Code code as follows:
# Run Docker in daemon mode
sudo <path to>/docker-h 0.0.0.0:5555-d &
# Download an Ubuntu image
sudo docker-h: 5555 pull Ubuntu
You can be using multiple-H for example you want to monitor all of your TCP and UNIX sockets
Copy Code code as follows:
# Run Docker in daemon mode
sudo <path to>/docker-h tcp://127.0.0.1:4243-h unix:///var/run/docker.sock-d &
# Download An Ubuntu image, use default Unix socket
sudo docker pull Ubuntu
# OR Use the TCP port
sudo docker-h tcp://127.0.0.1:4243 pull Ubuntu