Centos7 install Docker and set boot boot __docker self

Source: Internet
Author: User
Tags gpg symlink docker hub docker run
Setting up Boot
[Root@localhost ~]# Systemctl enable Docker
Created symlink from/etc/systemd/system/multi-user.target.wants/ Docker.service To/usr/lib/systemd/system/docker.service.
And then
[root@localhost ~] #shutdown-R now reboot
[Root@localhost ~]# systemctl status Docker see if the status is started
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------
Here is the reference URL
[Root@localhost ~]# uname-r
Update Kernel: If the production machine must be careful to update the kernel to avoid unnecessary problems.
sudo yum update
Install Docker
[root@localhost ~]# Curl-ssl https://get.docker.com/| SH 
+ sh-c ' sleep 3; yum-y-Q install docker-engine ' Delta RPMs disabled because/usr/bin/applydeltarpm not
Insta lled.
Warning:/var/cache/yum/x86_64/7/docker-main-repo/packages/docker-engine-selinux-1.10.3-1.el7.centos.noarch.rpm : Header V4 rsa/sha512 Signature, key ID 2c52609d:nokey public
key for Docker-engine-selinux-1.10.3-1.el7.centos.noa RCH.RPM is isn't installed
importing GPG key 0x2c52609d:
 Userid     : "Docker release Tool (Releasedocker) <dock Er@docker.com> "
 fingerprint:5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
Setsebool:  SELinux is disabled.

If you are would like Docker as a non-root user, your should now consider adding your
user to the "Docker" group WI  Th something like:

  sudo usermod-ag docker your-user Remember so you'll have to log out and then

To take effect!
Start Docker
[root@localhost ~]# sudo service docker start
redirecting To/bin/systemctl start  Docker.service
[Root@localhost ~]# sudo docker run Hello-world unable to find image ' hello-world:latest ' locally latest:pulling from Lib Rary/hello-world 03f4658f8b78:pull Complete A3ed95caeb02:pull complete digest:sha256 : 8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7 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 Docker client contacted the Docker.
 2. The Docker daemon pulled the "Hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from this image which runs the executable that produces the output for you AR
 e currently reading.

4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run a Ubuntu container with: $ docker run-it Ubuntu bash Share images, automa Te workflows, and MorE with a free Docker Hub account:https://hub.docker.com for more examples and ideas, visit:https://docs.docker.com/us erguide/
Setting up Boot
[Root@localhost ~]# Systemctl enable Docker
Created symlink from/etc/systemd/system/multi-user.target.wants/ Docker.service To/usr/lib/systemd/system/docker.service.
To add a specified user to a user group
Usermod-ag Docker your_username

Exit, and then log back in to allow permissions to take effect.

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.