Installing docker CE on Ubuntu 16.04

Time:2021-4-18
<!-- /\* Font Definitions \*/ @font-face {font- family:Helvetica;  panose-1:2 11 6 4 2 2 2 2 2 4; mso-font- charset:0;  mso-generic-font- family:swiss;  mso-font- pitch:variable;  mso-font- signature:-536859905 -1073711037  905110;} @ font face {font family: Song Ti; panose-1:216031; MSO font- alt:SimSun;  mso-font- charset:134;  mso-generic-font- family:auto;  mso-font- pitch:variable;  mso-font- signature:3 680460288  22 0 262145 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font- charset:1;  mso-generic-font- family:roman;  mso-font- format:other;  mso-font- pitch:variable;  mso-font- signature:0 0  0 0 0 0;} @font-face {font- family:Calibri;  panose-1:2 15 5 2 2 2 4 3 2 4; mso-font- charset:0;  mso-generic-font- family:swiss;  mso-font- pitch:variable;  mso-font- signature:-536870145 1073786111  1 0 415 0;} @font-face {font- family:Consolas;  panose-1:2 11 6 9 2 2 4 3 2 4; mso-font- charset:0;  mso-generic-font- family:modern;  mso-font- pitch:fixed;  mso-font- signature:-520092929 1073806591  9 0 415 0;} @ font face {font family: "\ \ @ Song Ti"; panose-1:2 1 6 0 3 1; MSO font- charset:134;  mso-generic-font- family:auto;  mso-font- pitch:variable;  mso-font- signature:3 680460288  22 0 262145 0;} /\* Style Definitions \*/ p.MsoNormal,  li.MsoNormal ,  div.MsoNormal  {mso-style- unhide:no;  mso-style- qformat:yes;  mso-style-parent:"";  margin:0cm;  margin- bottom:.0001pt;  text- align:justify;  text- justify:inter-ideograph;  mso-p agination:none;  font- size:10.5pt;  mso-bidi-font- size:11.0pt;  font-family:"Calibri","sans-serif"; mso-ascii-font- family:Calibri;  mso-ascii-theme- font:minor-latin;  MSO Fareast font family: song style; mso-fareast-theme- font:minor-fareast;  mso-hansi-font- family:Calibri;  mso-hansi-theme- font:minor-latin;  mso-bidi-font-family:"Times New Roman"; mso-bidi-theme- font:minor-bidi;  mso-font- kerning:1.0pt; } code {mso-style- noshow:yes;  mso-style- priority:99;  mso-ansi-font- size:12.0pt;  mso-bidi-font- size:12.0pt;  Font family: song style; MSO ASCII font family: Song typeface; MSO Fareast font family: Song typeface; MSO Hansi font family: Song typeface; MSO bidi font family: Song typeface;} pre {MSO style- noshow:yes;  mso-style- priority:99;  MSO style link: "HTML default format char"; margin:0cm;  margin- bottom:.0001pt;  mso-p agination:widow-orphan;  font- size:12.0pt;  Font family: Song typeface; MSO bidi font family: Song typeface; }  span.HTMLChar  {MSO style name: "HTML default format char"; MSO style- noshow:yes;  mso-style- priority:99;  mso-style- unhide:no;  mso-style- locked:yes;  MSO style link: "HTML default format"; MSO ANSI font- size:12.0pt;  mso-bidi-font- size:12.0pt;  Font family: song style; MSO ASCII font family: song style; MSO Fareast font family: song style; MSO Hansi font family: song style; MSO bidi font family: Song typeface- kerning:0pt; }  span.apple -converted-space {mso-style- name:apple-converted-space;  mso-style- unhide:no; } .MsoChpDefault {mso-style- type:export-only;  mso-default- props:yes;  mso-bidi-font-family:"Times New Roman"; mso-bidi-theme- font:minor-bidi; } /\* Page Definitions \*/ @page {mso-page-border-surround- header:no;  mso-page-border-surround- footer:no; } @page WordSection1 { size:595.3pt 841.9pt;  margin:72.0pt 90.0pt  72.0pt 90.0pt; mso-header- margin:42.55pt;  mso-footer- margin:49.6pt;  mso-paper- source:0;  layout- grid:15.6pt; }  div.WordSection1  { page:WordSection1; } -->

Step 1: update all software

First, we need to make sure that we are using a clean system. Run apt update.

apt-get update

Step 2: set up the repository

Install the package to enable apt to use the repository on HTTPS

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

Add docker’s official GPG key

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

Use the following command to set up a stable repository.

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

Step 3: install docker CE

apt-get update
apt-get install docker-ce

Step 4: create a user

If you decide not to use docker as root, you need to create a non root user.

Warning: the docker team grants privileges equivalent to root.

adduser user
usermod -aG docker user

Restart docker

systemctl restart docker

Step 5: Test docker

Run docker Hello world container to test whether the installation has completed successfully.

docker run hello-world

You will see the following output.

Hello from Docker!

This message shows that your installation seems to be working properly.

Step 6: configure docker to start

Finally, let docker run when your system starts.

systemctl enable docker

congratulations! You have successfully installed docker.

Recommended Today

Learn JavaScript syntax and API again

1、 Understanding the relationship between ECMAScript and JavaScript A common question is, what is the relationship between ECMAScript and JavaScript? To clarify this issue, we need to review history. In November 1996, Netscape, the creator of JavaScript, decided to submit JavaScript to ECMA, hoping that this language would become an international standard. Next year, ECMA […]