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

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.

主站蜘蛛池模板: 伊春市| 虞城县| 齐齐哈尔市| 阳泉市| 巴东县| 黄梅县| 从江县| 甘谷县| 晋宁县| 沙河市| 新宾| 洞头县| 东至县| 黑龙江省| 宝应县| 新田县| 德惠市| 车致| 麻栗坡县| 潞西市| 嘉鱼县| 昌宁县| 邵阳县| 乌海市| 洛隆县| 涡阳县| 易门县| 白山市| 海丰县| 泽普县| 肇庆市| 北京市| 龙江县| 同仁县| 舒城县| 邵阳县| 莱西市| 金阳县| 印江| 杨浦区| 临邑县|