官术网_书友最值得收藏!

  • Docker Quick Start Guide
  • Earl Waud
  • 486字
  • 2021-06-10 19:07:02

Installing Docker CE via the Docker Repository

We need to set up the Docker repository first, and then we can do the installation, so let's take care of the repo now.

The first step will be to update the apt package index. Use the following command to do that:

# update apt-get libraries
sudo apt-get update

Now we need to install some supporting packages:

# install required packages
sudo apt-get install \

apt-transport-https \
ca-certificates \
curl \
software-properties-common

Next, we need to get the GPG key for Docker:

# get the GPG key for docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo apt-key add -

You can confirm that you have added Docker's GPG key successfully; it will have a fingerprint of 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88

You can verify the key by checking the last eight characters match 0EBFCD88 with this command:

# validating the docker GPG key is installed
sudo apt-key fingerprint 0EBFCD88

Finally, we need to actually set up the repository. We will be focusing on the stable repo for our examples.

If you want to install the edge or test versions of Docker CE, be sure to add the word edge or test after the word stable (do not replace the word stable) in the following command:

# adding the docker repository
sudo add-apt-repository \

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

Now that our system is set up with the correct repository for installing Docker CE, let's install it.

Start by making sure that all of the packages are up to date by issuing the apt-get update command:

# update apt-get libraries again
sudo apt-get update

And now we will actually install Docker CE:

# install docker
sudo apt-get install docker-ce

Docker is installed. You can check the Docker version after the install to confirm a successful installation:

# validate install with version command
docker --version

The version command should look something like this:

Now, let's validate that the Docker installation is working as desired. To do this, we will run the hello-world Docker image using the following command:

# validating functionality by running a container
sudo docker run hello-world

Did you notice something interesting happened?

We did not have to start Docker after the installation as we did in the CentOS installation. That is because, on DEB-based Linux systems, the install process also starts Docker for us. Additionally, the Ubuntu workstation is configured to start Docker on boot. So both of the Docker start steps are handled for you during the installation. Nice! Your Ubuntu workstation now has Docker installed and we've verified it is working as desired. 

Although using the Docker repository is the best way to install Docker on your workstation, let's take a quick look at another way to install Docker CE on an Ubuntu workstation, that being by manually installing it with a DEB package.

主站蜘蛛池模板: 霍邱县| 纳雍县| 庆阳市| 平谷区| 德令哈市| 榕江县| 曲沃县| 福贡县| 德江县| 天祝| 安福县| 毕节市| 刚察县| 仙居县| 广州市| 深水埗区| 甘肃省| 高清| 石泉县| 昆山市| 襄城县| 房产| 平顺县| 富锦市| 濮阳市| 南雄市| 新化县| 濉溪县| 黄浦区| 丰镇市| 中卫市| 平顶山市| 仙居县| 富宁县| 邵东县| 安吉县| 昌平区| 乐昌市| 密云县| 禹州市| 开远市|