Docker basic deployment (based on ubuntu under)

A. Installation docker 

Terminal mode:

sudo apt-get install docker-ce (Community Edition)

II. Start docker

sudo systemctl start docker

III. View docker version

sudo docker --version

IV. Configuring mirrored pull addresses (due to the mirrored servers in foreign countries, pulling very slow, so it is necessary to accelerate the use of domestic mirror server, here with Netease, self-configurable Ali, etc.)

1. Initialize daemon.json empty, which modify the content

south you /etc/docker/daemon.json

2. Add the mirror source and save

 {"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"] }

3. Re-load configuration file

sudo systemctl reload daemon

4. Restart dcoker

sudo systemctl restart docker

Note: In this step it is possible docker not start, and that is a problem daemon configuration file, in case the daemon configuration conflicts delete all hidden files and reconfiguring

V. pull the mirror and run the container (redis example, the most recent version)

1、sudo docker pull redis:latest

2、sudo docker run -itd --name redis-test -p 6379:6379 redis

VI. View mirror (this step basically even build complete)

sudo docker images

Seven .docker view of some commonly used commands

sudo docker --help

VIII. Can be deployed docker visualization cluster management container portainer

Guess you like

Origin www.cnblogs.com/smiledragon/p/12350060.html