Before installing things, you need to know what docker is and what docker can do. The article is the process of writing and testing by myself.
http://t.csdn.cn/iqbGg Blog article link introduces docker in detail, and deploys MySQL, nginx and other configurations
1. Install Docker on liunx system (VMware)
1. Docker Chinese website address: Docker Chinese website official website (p2hp.com)
2. Open VMware and use su root to enter administrator mode
3. Add Docker installation source
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
The screen shown in the figure shows success
4. Install the latest version of Docker
sudo yum install docker-ce docker-ce-cli containerd.io
As shown in the figure below, enter y and press Enter,
and then the following screen will appear to continue y, then press Enter to complete the work.
The following screen will appear, continue to enter y, and then press Enter to officially start the installation
The installation is complete!!!
or
2. Select the specified version to install
1. Use the following command to list all available packages and versions and sort them in reverse order:
sudo yum list docker-ce --showduplicates | sort -r
2. Select the Docker version you specified to install
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
During the installation process, the system will prompt you whether to confirm the installation, enter Y to continue the installation, the same as above
3. Test whether Docker is installed successfully
1. Start a Hello word container and enter the following command
sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
The above screen appears to indicate that the installation is successful
2. Stop the Docker service
sudo systemctl stop docker
4. Configure Docker
1. Start Docker and run the following code in the terminal
sudo systemctl start docker
2. To set Docker to start automatically, enter the following command
sudo systemctl enable docker
3. View Docker version information including client and server
sudo docker version
4. View Docker details
sudo docker info
Displays details of Docker, the status and configuration of the docker daemon
5. Search for Docker images
To search for Docker images available in Docker Hub, enter the following command
将<image_name>替换为您要搜索的镜像名称
sudo docker search <image_name>
For example, if you want to search Centos mirrors, run the following command:
sudo docker search centos
6. Download the Docker image
将<image_name>替换为您要拉取的镜像名称
sudo docker pull <image_name>
7. List the mirrors you downloaded, the mirrors in the local
sudo docker images
will list the names and versions of all downloaded Docker images.
8. Run the downloaded docker container
Replace with the option you want to use and replace <image_name> with the image name you want to use. For example, if you want to run a new container on an Ubuntu image, run the following command:
sudo doceker run <option> <image_name>