Linux CentOS7 安装Docker

Stella981
• 阅读 614

安装Docker

wget -qO- https://get.docker.com/|sh

[root@localhost ~]# wget -qO- https://get.docker.com/|sh
# Executing docker install script, commit: fc04d2c
+ sh -c 'yum install -y -q yum-utils'
+ sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/                                                                   docker-ce.repo'
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yu                                                                   m.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' edge '!=' stable ']'
+ sh -c 'yum-config-manager --enable docker-ce-edge'
Loaded plugins: fastestmirror
============================= repo: docker-ce-edge =============================
[docker-ce-edge]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl = https://download.docker.com/linux/centos/7/x86_64/edge
cache = 0
cachedir = /var/cache/yum/x86_64/7/docker-ce-edge
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 1
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7/docker-ce-edge/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7/docker-ce-edge/gpgdir
gpgkey = https://download.docker.com/linux/centos/gpg
hdrdir = /var/cache/yum/x86_64/7/docker-ce-edge/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = Docker CE Edge - x86_64
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/docker-ce-edge
pkgdir = /var/cache/yum/x86_64/7/docker-ce-edge/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = docker-ce-edge/x86_64
ui_repoid_vars = releasever,
   basearch
username =

+ sh -c 'yum makecache'
Loaded plugins: fastestmirror
base                                                     | 3.6 kB     00:00
docker-ce-edge                                           | 2.9 kB     00:00
docker-ce-stable                                         | 2.9 kB     00:00
extras                                                   | 3.4 kB     00:00
updates                                                  | 3.4 kB     00:00
(1/6): docker-ce-edge/x86_64/primary_db                    |  14 kB   00:00
(2/6): docker-ce-edge/x86_64/filelists_db                  | 8.3 kB   00:00
(3/6): docker-ce-edge/x86_64/other_db                      |  61 kB   00:00
(4/6): docker-ce-stable/x86_64/primary_db                  |  11 kB   00:01
(5/6): docker-ce-stable/x86_64/other_db                    |  65 kB   00:00
(6/6): docker-ce-stable/x86_64/filelists_db                | 6.9 kB   00:03
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.cn99.com
Metadata Cache Created
+ sh -c 'yum install -y -q docker-ce'
http://mirrors.shu.edu.cn/centos/7.4.1708/extras/x86_64/Packages/pigz-2.3.3-1.el                                                                   7.centos.x86_64.rpm: [Errno 12] Timeout on http://mirrors.shu.edu.cn/centos/7.4.                                                                   1708/extras/x86_64/Packages/pigz-2.3.3-1.el7.centos.x86_64.rpm: (28, 'Operation                                                                    too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
https://download.docker.com/linux/centos/7/x86_64/edge/Packages/docker-ce-18.02.                                                                   0.ce-1.el7.centos.x86_64.rpm: [Errno 12] Timeout on https://download.docker.com/                                                                   linux/centos/7/x86_64/edge/Packages/docker-ce-18.02.0.ce-1.el7.centos.x86_64.rpm                                                                   : (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 sec                                                                   onds')
Trying other mirror.
warning: /var/cache/yum/x86_64/7/docker-ce-edge/packages/docker-ce-18.02.0.ce-1.                                                                   el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for docker-ce-18.02.0.ce-1.el7.centos.x86_64.rpm is not installed
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemo                                                                   n-attack-surface
         for more information.

提示:warning: /var/cache/yum/x86_64/7/docker-ce-edge/packages/docker-ce-18.02.0.ce-1. el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Public key for docker-ce-18.02.0.ce-1.el7.centos.x86_64.rpm is not installed

本意:docker-ce-18.02.0.ce-1.el7.centos.x86_64.rpm 公钥未安装,key没有导入

[root@localhost ~]# wget  https://get.docker.com/gpg
--2018-03-01 23:30:16--  https://get.docker.com/gpg
Resolving get.docker.com (get.docker.com)... 54.192.212.188, 54.192.212.223, 54.                                                                   192.212.14, ...
Connecting to get.docker.com (get.docker.com)|54.192.212.188|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 975 [binary/octet-stream]
Saving to: ‘gpg’

100%[======================================>] 975         --.-K/s   in 0s

2018-03-01 23:30:18 (122 MB/s) - ‘gpg’ saved [975/975]

[root@localhost ~]# rpmkeys --import ./gpg

启动docker

[root@localhost ~]# systemctl start docker.service

查看docker

[root@localhost ~]# docker version
Client:
 Version:       18.02.0-ce
 API version:   1.36
 Go version:    go1.9.3
 Git commit:    fc4de44
 Built: Wed Feb  7 21:14:12 2018
 OS/Arch:       linux/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.02.0-ce
  API version:  1.36 (minimum version 1.12)
  Go version:   go1.9.3
  Git commit:   fc4de44
  Built:        Wed Feb  7 21:17:42 2018
  OS/Arch:      linux/amd64
  Experimental: false

可以看到docker的客户端和服务端的信息,则docker服务启动成功

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Stella981 Stella981
3年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这