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

Adding the Docker repository to APT sources

For Ubuntu 16.04, add the following:

$ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list

For Ubuntu 18.04, add the following:

$ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list 

Updating the package database with the Docker packages from the newly added repository is done as follows:

$ sudo apt-get update

Make sure that we are about to install from the Docker repository instead of the default Ubuntu repository:

$ apt-cache policy docker-engine

Notice that docker-engine is not installed yet; to install docker-engine, use the following command:

$ sudo apt-get install -y docker-engine

Check whether Docker is started or not:

$ sudo systemctl status docker

To start the Docker service, use the following command:

$ sudo service docker start
$ docker

We can search for images available on Docker Hub by using the docker command with the search subcommand:

$ sudo docker search Ubuntu

To run the Docker container, use the following command:

$ sudo docker run -it hello-world
主站蜘蛛池模板: 温泉县| 卢湾区| 井研县| 陵川县| 苍南县| 泗水县| 萨迦县| 枣阳市| 嘉定区| 鄯善县| 长汀县| 嘉善县| 红安县| 万全县| 遵义县| 岳池县| 景谷| 县级市| 综艺| 庆城县| 高邑县| 宁陵县| 南川市| 莎车县| 泽普县| 湟中县| 喀喇沁旗| 买车| 山东省| 瑞金市| 固始县| 新河县| 通榆县| 塔城市| 方城县| 平阳县| 舒城县| 牡丹江市| 克什克腾旗| 林芝县| 墨脱县|