[Self-study Docker] One article solves Docker installation

Docker CentOS installation

Docker version

Docker uses the timeline as the version number after version 1.13, and is divided into community version CE and enterprise version EE.

The Docker Community Edition is free for individual developers and small groups to use, and the Enterprise Edition will provide additional fee-based services, such as infrastructure, containers, plug-ins, etc. that have passed official testing and certification.

The Docker community version is released in two ways: stable and edge. The stable version is updated every quarter, such as 17.06 and 17.09; the edge version is updated every month, such as 17.09 and 17.10.

Docker CentOS installation

1. Installation

[root@localhost ~]# cat /etc/redhat-release 

CentOS Linux release 7.0.1406 (Core) 

Use the cat /etc/redhat-release command to view the current Linux release version.

2. Check the kernel version

[root@localhost ~]# uname -r
3.10.0-123.el7.x86_64

Docker installation requires the kernel version of the CentOS system to be higher than 3.10, and the current kernel version can be viewed through the uname -r command.

3. Update yum

[root@localhost ~]# yum update

Log in to Centos with root privileges. Make sure the yum package is updated to the latest.

4. Uninstall the old version

[root@localhost ~]# yum remove docker  docker-common docker-selinux docker-engine
已加载插件:fastestmirror, langpacks
参数 docker 没有匹配
参数 docker-common 没有匹配
参数 docker-selinux 没有匹配
参数 docker-engine 没有匹配
不删除任何软件包

If an old version is installed, use yum remove to uninstall the old version.

5. Install the package

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

Install the required software packages, yum-util provides the yum-config-manager function, and the other two are dependent on the devicemapper driver.

The installation is successful, as shown in the figure below:

Please add a picture description

6. Set yum source

[root@localhost ~]# yum-config-manager --add-repo

Set the Docker yum source, and the setting is successful, as shown in the following figure:

Please add a picture description

7. View the Docker repository

[root@localhost ~]# yum list docker-ce --showduplicates | sort -r

Use yum list to view all versions of Docker that can be installed, as shown in the following figure:

Please add a picture description

8. Install Docker

[root@localhost ~]# yum install docker-ce

Since only the stable warehouse is enabled by default in the Docker repo, the latest stable version is installed here. The installation is successful, as shown below:

Please add a picture description

9. Start Docker

[root@localhost ~]# systemctl start docker

10. View Docker status

[root@localhost ~]# systemctl status docker

Docker starts successfully, the interface is as follows:

Please add a picture description

11. Docker joins startup items

[root@localhost ~]# systemctl enable docker

Join successfully, the interface is as follows:

Please add a picture description

12. View startup items

[root@localhost ~]# systemctl list-unit-files | grep docker

After adding the startup item, the interface is as follows:

Please add a picture description

Docker Ubuntu installation

Docker version

Docker uses the timeline as the version number after version 1.13, and is divided into community version CE and enterprise version EE.

The Docker Community Edition is free for individual developers and small groups to use, and the Enterprise Edition will provide additional fee-based services, such as infrastructure, containers, plug-ins, etc. that have passed official testing and certification.

The Docker community version is released in two ways: stable and edge. The stable version is updated every quarter, such as 17.06 and 17.09; the edge version is updated every month, such as 17.09 and 17.10.

Docker Ubuntu installation

1. Uninstall the old version of Docker

haicoder(www.haicoder.net)# sudo apt-get remove docker docker-engine docker-ce docker.io

Since the version of docker in the apt official library may be relatively old, uninstall the old version that may exist first.

2. Update the apt package index

haicoder(www.haicoder.net)# sudo apt-get update

3. Install the package

haicoder(www.haicoder.net)# sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

Install the above packages to make the repository available to apt over HTTPS.

4. Add the official Docker GPG key

haicoder(www.haicoder.net)# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

5. Setting up the stable repository

haicoder(www.haicoder.net)# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"

Use the above command to set Docker's stable repository. If there is an error here, please refer to the bottom error to solve it.

6. Update the apt package index

haicoder(www.haicoder.net)# sudo apt-get update

Update the apt package index again.

7. Install the latest version of Docker CE

haicoder(www.haicoder.net)# sudo apt-get install -y docker-ce

8. Start the Docker service

haicoder(www.haicoder.net)# sudo systemctl start docker

9. View Docker services

haicoder(www.haicoder.net)# systemctl status docker

Docker Ubuntu installation error resolution

If an error is reported when setting the stable repository, and the error is as shown in the figure below:

Please add a picture description

Then, we need to use vim to edit /etc/apt/source.listthe file, as shown below:

Please add a picture description

Comment out [arch=amd64]the lines in the file, and keep only one required installation package, as shown in the following figure:

Please add a picture description


Docker Windows installation

Docker version

Docker uses the timeline as the version number after version 1.13, and is divided into community version CE and enterprise version EE.

The Docker Community Edition is free for individual developers and small groups to use, and the Enterprise Edition will provide additional fee-based services, such as infrastructure, containers, plug-ins, etc. that have passed official testing and certification.

The Docker community version is released in two ways: stable and edge. The stable version is updated every quarter, such as 17.06 and 17.09; the edge version is updated every month, such as 17.09 and 17.10.

Docker Windows installation instructions

Docker released the official version of Docker for Windows, so you can run Docker containers under Windows. To run Docker under Windows, the following prerequisites are required:

64-bit Windows 10 Pro, Enterprise, or Education editions (Build 10586 and above, need to install 1511 November update).

Enable Hyper-V in the system. If not enabled, Docker for Windows will automatically enable Hyper-V during the installation process (this process requires a system restart). However, if you are not using Windows 10, it does not matter, you can use Docker ToolBox as an alternative.

Docker WindowsDownload

1 Download URL

https://www.docker.com/products/docker-desktop

2 click to download

Click the Download button, as shown below:

Please add a picture description

3 Register an account

Click the Download button to jump to the account registration page, as shown in the figure below:

Please add a picture description

4 Registration page

Click the Create Account button to jump to the page for entering account information for the registered account, as shown in the following figure:

Please add a picture description

In the Enter a docker ID input box, enter any Docker ID, Password input box, enter the registration password, and Eamil input box, enter the email address used for registration. The email address must be an email address that you can log in, because the account needs to be activated through the email address below.

After all the above information is entered, click the two I agree to radio boxes below to express agreement with the official Docker agreement. If you do not check the box, you cannot proceed to the next step. Finally, click the robot verification radio button again. After the verification is successful, the account registration is successful.

5 Email pages

After all the above information is entered correctly, click the Create Account button, and you will receive an email to activate the account in the email address you filled in during registration, as shown in the figure below:

Please add a picture description

6 Login screen

After clicking the email to activate the account received in the mailbox, click the Confirm button, and then automatically jump to the account login interface, as shown in the following figure:

Please add a picture description

In the first input box, enter the Docker ID filled in when you just registered. In the second input box, enter the password filled in when you just registered, and click the Sign In button to log in.

7 Download page

After entering the correct Docker ID and password, click Sign In to jump to the download page, the download page, as shown in the following figure:

Please add a picture description

8 start download

Click the Get Started button to jump to the start download page, as shown in the following figure:

Please add a picture description

Click the Download Docker button to start the download.

9 download complete

After the download is complete, the file is as shown in the figure below:

Please add a picture description

Enable Hyper-V

1 Start menu

Open the system's start menu, find applications and functions, as shown in the following figure:

Please add a picture description

2 Programs and Features

Click Apps and Features in the system start menu, as shown in the figure below:

Please add a picture description

Open the Windows features inside to open Hyper-v.

Docker Windows installation

1 installation

Click the downloaded installer, double-click, step by step next, and the installation is successful. After the installation is successful, use Windows search to see Docker, as shown in the following figure:

Please add a picture description

After clicking Run, the Docker icon will appear on the toolbar, as shown in the following figure:

Please add a picture description

Guess you like

Origin blog.csdn.net/weixin_41384860/article/details/128684136
Recommended