Installing and running Docker under Linux

Source: Internet
Author: User
Tags docker hub docker run

Writer Environment:

1.lsb_release-a

[Email protected]:~$ lsb_release-a
No LSB modules is available.
Distributor Id:ubuntu
Description:ubuntu 16.04.3 LTS
release:16.04
Codename:xenial

2. Updating apt and installing GPG keys

2.1 sudo apt-get update

2.2 sudo apt-get install Apt-transport-https ca-certificates

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

3. Edit the source file

sudo vi/etc/apt/source.list.d/docker.list (this file does not exist and can be created directly)

Delete all the contents of the file and write the contents into the following:

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

4. Update APT Package index

sudo apt-get update

5. Installing Docker

sudo apt-get install Docker-engine

6. Start Docker

sudo service docker start

7. Verify that Docker is running

sudo Docker run Hello-world

The writer runs the following results:

[Email protected]:~$ sudo docker run Hello-world
Unable to find image ' hello-world:latest ' locally
Latest:pulling from Library/hello-world
B04784fba78d:pull Complete
Digest:sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
status:downloaded newer image for Hello-world:latest

Hello from docker!
This message shows the your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "Hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
Executable that produces the output is currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something + ambitious, you can run a Ubuntu container with:
$ docker run-it Ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

8. Join the current user to the Docker group

sudo usermod-a-G docker Hello

9. Restart Docker

sudo service docker restart

Installing and running Docker under Linux

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.