Detailed Ubuntu 16.04 installation Docker Tutorial _docker

Source: Internet
Author: User
Tags docker run

This article describes the Ubuntu 16.04 installation Docker tutorial, as follows:

Environment

Operating system: Ubuntu 16.04 64-bit, default installation

Get ready

1. Add GPG key:

$ sudo apt-key adv--keyserver hkp://p80.pool.sks-keyservers.net:80--recv-keys 58118e89f3a912897c070adbf76221572c52609d

2. Add Source

New file:/etc/apt/sources.list.d/docker.list, add content inside:

Deb Https://apt.dockerproject.org/repo ubuntu-xenial Main

3. Update source

$ sudo apt update

Installation and Testing

Installation

$ sudo apt install docker-engine

Start and test

$ sudo service docker start 
$ sudo docker run Hello-world

Hello-world is mirrored, the mirror is downloaded from the Mirror library, and the results are as follows:

Configure Power-on Startup

Configuration

$ sudo systemctl enable Docker

Execute using the current user

If executed using the current user, the following error will be reported:

$ docker Run Hello-world
cannot connect to the Docker daemon. Is ' Docker daemon ' running in this host?

Therefore, the current user needs to be added to the group Docker, which is automatically created when the Docker is installed.

$ sudo usermod-ag docker ubuntu

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.