After all, I still can’t get around. There is really too much knowledge to learn. Fortunately, we still have time. I only heard the sound of docker before and never really contacted it. Now docker is getting more and more popular, and many companies have started. used. So for us programmers, we have to practice another necessary skill. So let us take the first step courageously, and let us learn from each other step by step. Let's start with the installation.
Reference: https://yeasy.gitbooks.io/docker_practice/content/install/windows.html
Win10 installation requires Hyper-V to be turned on first. Control Panel-->All Control Panel Items-->Programs and Features-->Enable or Disable Windows Features
Then download the installer: Stable or Edge
After downloading, directly double-click the screenshot after running.
Click close and log out to restart the computer.
After restarting the computer, there will be a docker icon in our navigation bar. Click the icon, select setting, genneral, and check the last option.
Set the mirror, we use the domestic mirror, which will increase the download speed, and set it in the setting daemon
https://registry.docker-cn.com
https://dockerhub.azk8s.cn
View the docker version in the cmd console
docker version
Run the hello-world image
docker run hello-world
It proves that docker is successfully installed on win 10. As for how to use it next, we will talk about it in the next article.
Mine is Ubuntu 18.0.4, the installation method is also very simple.
# Uninstall old version
sudo apt-get remove docker docker-engine docker.io
# Install package update
sudo apt-get update
# Installation dependencies
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# Add Docker official GPG key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Set up a stable Docker repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Install docker-ce
sudo apt-get install docker-ce
View the installed docker version
docker version
Run hello-world
docker run hello-world
Found that the following error did not appear
The docker process uses Unix Socket instead of TCP port. By default, the Unix socket belongs to the root user and requires root privileges to access it. So use
sudo docker run hello-world
Or add the current user to the docker user group. By default, the docker command uses Unix socket to communicate with the Docker engine. Only the root user and users in the docker group can access the Unix socket of the Docker engine. For security reasons, root users are not directly used on Linux systems. Therefore, it is better to add users who need to use docker to the docker user group.
# Create a docker group:
sudo groupadd docker
# Add the current user to the docker group:
sudo usermod -aG docker $USER
# Update user group
newgrp docker
# Test whether the docker command can be used normally with sudo
docker ps
So far, our win10 environment and ubuntu environment have already built docker. In the next part, let us continue to learn how to use docker.
Okay, just say so much
Recommended Posts