Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Docker CE in Ubuntu

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install Docker CE in Ubuntu, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

This article is used to record the installation of Docker CE under Ubuntu 17.10.

Installation dependency

There are the following restrictions on the installation of the Docker CE version under Ubuntu

64-bit OS

The OS of Ubuntu64bit is required. The confirmation method is as follows

Devops@ubuntu:~$ uname-mx86_64devops@ubuntu:~$

Version

The following versions of Ubuntu are supported

Artful 17.10

Xenial 16.04 (LTS)

Trusty 14.04 (LTS)

Note: Artful 17.10 only supports Docker CE17.11 Edge and later versions, because Artful itself is also a transitional version released in October 2017

Confirmation of the release code, such as Artful

Devops@ubuntu:~$ lsb_release-csartfuldevops@ubuntu:~$

Hardware

Ubuntu's support for Docker CE is not only required for 64-bit OS, but also for x86 CPU. In addition to x86, there are the following types of support

Armhf

S390x (IBM Z)

Ppc64le (IBM Power)

Devops@ubuntu:~$ uname-mx86_64devops@ubuntu:~$

Installation

Apt-get update

Use apt-get update to update the list of software in the source

Devops@ubuntu:~$ sudo su [sudo] password for devops: root@ubuntu:/home/devops# apt-get updateHit:1 http://cn.archive.ubuntu.com/ubuntu artful InRelease Get:2 http://cn.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB] Hit:3 http://cn.archive.ubuntu.com/ubuntu artful-backports InRelease Get:4 http://security.ubuntu.com/ubuntu artful- Security InRelease [78.6 kB] Get:5 http://cn.archive.ubuntu.com/ubuntu artful-updates/main i386 Packages [212 kB] Get:6 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages [216 kB] Get:7 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe i386 Packages [89.0 kB] Get:8 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe amd64 Packages [89.9 kB] Fetched 764 kB in 4s (163kB/s) Reading package lists... Doneroot@ubuntu:/home/devops#

Install the required package

Command: apt-get install apt-transport-https ca-certificates curl software-properties-common

Execution log

Root@ubuntu:/home/devops# apt-get install apt-transport-https ca-certificates curl software-properties-commonReading package lists... DoneBuilding dependency tree Reading state information... Doneca-certificates is already the newest version (20170717). Software-properties-common is already the newest version (0.96.24.17). The following additional packages will be installed: libcurl3The following NEW packages will be installed: apt-transport-httpsThe following packages will be upgraded: curl libcurl32 upgraded, 1 newly installed, 0 to remove and 53 not upgraded.Need to get 383 kB of archives.After this operation, 247 kB of additional disk space will be used.Do you want to continue? YGet:1 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 apt-transport-https amd64 1.5.1 [34.7 kB] Get:2 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 curl amd64 7.55.1-1ubuntu2.3 [152kB] Get:3 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 libcurl3 amd64 7.55.1-1ubuntu2. 3 [196 kB] Fetched 383 kB in 14s (26.2kB/s) perl: warning: Setting locale failed.perl: warning: Please check that your locale settings: LANGUAGE = "en_HK:en" LC_ALL = (unset), LC_CTYPE = "UTF-8" LANG = "en_HK.UTF-8" are supported and installed on your system.perl: warning: Falling back to a fallback locale ("en_HK.UTF-8"). Locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directorySelecting previously unselected package apt-transport-https. (Reading database... 63866 files and directories currently installed.) Preparing to unpack. / apt-transport-https_1.5.1_amd64.deb. .. Unpacking apt-transport-https (1.5.1)... Preparing to unpack... / curl_7.55.1-1ubuntu2.3_amd64.deb... Unpacking curl (7.55.1-1ubuntu2.3) over (7.55.1-1ubuntu2.2)... Preparing to unpack... / libcurl3_7.55.1-1ubuntu2.3_amd64.deb... Unpacking libcurl3:amd64 (7.55.1-1ubuntu2.3) over (7.55.1) -1ubuntu2.2)... Setting up apt-transport-https (1.5.1)... Setting up libcurl3:amd64 (7.55.1-1ubuntu2.3)... Processing triggers for libc-bin (2.26-0ubuntu2)... Processing triggers for man-db (2.7.6.1-2)... Setting up curl (7.55.1-1ubuntu2.3)... root@ubuntu:/home/devops#

Add GPG key

Use the following command to add the official GPG key of docker

Command: curl-fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add-

Execution log

Root@ubuntu:/home/devops# curl-fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add-OKroot@ubuntu:/home/devops#

The digital signature of this key is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, so it can be confirmed with its last 8 bits

Root@ubuntu:/home/devops# apt-key fingerprint 0EBFCD88pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88uid [unknown] Docker Release (CE deb) sub rsa4096 2017-02-22 [S] root@ubuntu:/home/devops#

Set up the stable source repository

Use the following command to set the stable source repository for the x86 installation type

Command: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release-cs) stable"

For other types of transformation, please see the following for the corresponding relationship. Just replace the arch=amd64 in the above command.

Execution log:

Root@ubuntu:/home/devops# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release-cs) stable" root@ubuntu:/home/devops#

Apt-get update

Use apt-get update to update the list of software in the source again

Root@ubuntu:/home/devops# apt-get updateHit:1 http://cn.archive.ubuntu.com/ubuntu artful InRelease Get:2 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB] Get:3 http://cn.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB] Hit:4 http://cn.archive.ubuntu.com/ubuntu artful-backports InRelease Get:5 https://download.docker.com/linux/ubuntu artful InRelease [51.9 kB] Get:6 https://download.docker.com/linux/ubuntu artful/stable amd64 Packages [1462 B] Fetched 211 kB in 2s (85.8 kB/s) Reading package lists... Doneroot@ubuntu:/home/devops#

Install docker-ce

Root@ubuntu:/home/devops# apt-get install docker-ceReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following additional packages will be installed: aufs-tools cgroupfs-mount libltdl7The following NEW packages will be installed: aufs-tools cgroupfs-mount docker-ce libltdl70 upgraded, 4 newly installed, 0 to remove and 53 not upgraded.Need to get 29.9 MB of archives.After this operation, 150 MB of additional disk space will be used.Do you want to continue? [Yapin] yGet:1 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe amd64 aufs-tools amd64 1 bank 4.1 [20161219-1ubuntu0.1 [102kB] Get:2 https://download.docker.com/linux/ubuntu artful/stable amd64 docker-ce amd64 17.12.1~ce-0~ubuntu [29.8MB] Get:3 http://cn.archive.ubuntu.com/ubuntu artful/universe amd64 cgroupfs-mount all 1.4 [6320 B] Get:4 http://cn .archive.ubuntu.com / ubuntu artful/main amd64 libltdl7 amd64 2.4.6-2 [38.8 kB] Fetched 29.9 MB in 8s (3536 kB/s) perl: warning: Setting locale failed.perl: warning: Please check that your locale settings: LANGUAGE = "en_HK:en" LC_ALL = (unset), LC_CTYPE = "UTF-8" LANG = "en_HK.UTF-8" are supported and installed on your system.perl: warning: Falling back to a fallback locale ("en_HK.UTF-8"). Locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directorySelecting previously unselected package aufs-tools. (Reading database... 63874 files and directories currently installed.) Preparing to unpack. / aufs-tools_1%3a4.1+20161219-1ubuntu0.1_amd64.deb. .. Unpacking aufs-tools (1Selecting previously unselected package cgroupfs-mount.Preparing to unpack 4.1-20161219-1ubuntu0.1)... Selecting previously unselected package cgroupfs-mount.Preparing to unpack... / cgroupfs-mount_1.4_all.deb... Unpacking cgroupfs-mount (1.4)... Selecting previously unselected package libltdl7:amd64.Preparing to unpack... / libltdl7_2.4.6-2_amd64.deb... Unpacking libltdl7:amd64 (2.4.6-2)... Selecting previously unselected package docker-ce.Preparing To unpack... / docker-ce_17.12.1~ce-0~ubuntu_amd64.deb... Unpacking docker-ce (17.12.1~ce-0~ubuntu)... Setting up aufs-tools (1Unpacking docker-ce 4.1 / 20161219-1ubuntu0.1)... Processing triggers for ureadahead (0.100.0-20)... Setting up cgroupfs-mount (1.4)... Processing triggers for libc-bin (2.26-0ubuntu2)... Processing triggers for systemd (234-2ubuntu12.1) ... Setting up libltdl7:amd64 (2.4.6-2)... Processing triggers for man-db (2.7.6.1-2)... Setting up docker-ce (17.12.1~ce-0~ubuntu)... Created symlink / etc/systemd/system/multi-user.target.wants/docker.service → / lib/systemd/system/docker.service.Created symlink / etc/systemd/system/sockets.target.wants/docker.socket → / lib/systemd/system / docker.socket.Processing triggers for ureadahead (0.100.0-20)... Processing triggers for libc-bin (2.26-0ubuntu2)... Processing triggers for systemd (234-2ubuntu12.1)... root@ubuntu:/home/devops#

Specify version installation

If you want to specify the version of the installation, you need to specify the docker-ce=17.12.1~ce-0~ubuntu version at the time of installation

Root@ubuntu:/home/devops# apt-cache madison docker-ce docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packagesroot@ubuntu:/home/devops#root@ubuntu:/home/devops# apt-get install docker-ce=17.12.1~ce-0~ubuntuReading package lists... DoneBuilding dependency tree Reading state information... Donedocker-ce is already the newest version (17.12.1~ce-0~ubuntu) .0 upgraded, 0 newly installed, 0 to remove and 53 not upgraded.root@ubuntu:/home/devops#

Confirm after installation

Version confirmation

Root@ubuntu:/home/devops# docker versionClient: Version: 17.12.1-ce API version: 1.35 Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:17:53 2018 OS/Arch: linux/amd64Server: Engine: Version: 17.12.1-ce API version: 1.35 (minimum version 1.12) Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:16:25 2018 OS/Arch: linux/amd64 Experimental: falseroot@ubuntu:/home/devops#

Overall information

You can see a lot of basic information, such as overlay2 storage.

Root@ubuntu:/home/devops# docker infoContainers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 17.12.1-ceStorage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: trueLogging Driver: json-fileCgroup Driver: cgroupfsPlugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslogSwarm: inactiveRuntimes: runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 9b55aab90508bd389d7654c4baf173a981477d55runc version: 9f9c96235cc97674e935002fc3d78361b696a69einit version: 949e6faSecurity Options: apparmor seccomp Profile: defaultKernel Version: 4.13.0-21 -genericOperating System: Ubuntu 17.10OSType: linuxArchitecture: x86_64CPUs: 1Total Memory: 988.7MiBName: ubuntuID: TYYA:4LWB:YTHA:2DNB:XBXM:NFNP:ADMY:VZEJ:2ZBN:KPKW:PTML:S5A2Docker Root Dir: / var/lib/dockerDebug Mode (client): falseDebug Mode (server): falseRegistry: https://index.docker.io/v1/Labels:Experimental: falseInsecure Registries: 127.0.0.0/8Live Restore Enabled: falseWARNING: No swap limit supportroot@ubuntu:/home/devops# Thank you for reading this article I hope the article "how to install Docker CE in Ubuntu" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report