• centos7安装 docker

切换到 root用户,执行:

[root@localhost frinder]# yum install docker
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================================================
Package 架构 版本 源 大小
=================================================================================================================================================================
正在安装:
docker x86_64 2:1.12.6-11.el7.centos extras 20 M
为依赖而安装:
container-selinux noarch 2:2.9-4.el7 extras 26 k
docker-client x86_64 2:1.12.6-11.el7.centos extras 4.4 M
docker-common x86_64 2:1.12.6-11.el7.centos extras 71 k
oci-register-machine x86_64 1:0-1.11.gitdd0daef.el7 extras 1.1 M
oci-systemd-hook x86_64 1:0.1.4-9.git671c428.el7 extras 29 k
skopeo-containers x86_64 1:0.1.18-1.el7 extras 7.6 k

事务概要
=================================================================================================================================================================
安装 1 软件包 (+6 依赖软件包)

总下载量:26 M
安装大小:104 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/extras/packages/container-selinux-2.9-4.el7.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
container-selinux-2.9-4.el7.noarch.rpm 的公钥尚未安装
(1/7): container-selinux-2.9-4.el7.noarch.rpm | 26 kB 00:00:00
(2/7): docker-client-1.12.6-11.el7.centos.x86_64.rpm | 4.4 MB 00:00:04
(3/7): docker-common-1.12.6-11.el7.centos.x86_64.rpm | 71 kB 00:00:00
(4/7): oci-register-machine-0-1.11.gitdd0daef.el7.x86_64.rpm | 1.1 MB 00:00:01
(5/7): oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64.rpm | 29 kB 00:00:00
(6/7): skopeo-containers-0.1.18-1.el7.x86_64.rpm | 7.6 kB 00:00:00
(7/7): docker-1.12.6-11.el7.centos.x86_64.rpm | 20 MB 00:00:13
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 1.9 MB/s | 26 MB 00:00:13
从 http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
来自 : http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : 2:docker-common-1.12.6-11.el7.centos.x86_64 1/7
正在安装 : 2:docker-client-1.12.6-11.el7.centos.x86_64 2/7
正在安装 : 1:oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64 3/7
正在安装 : 1:oci-register-machine-0-1.11.gitdd0daef.el7.x86_64 4/7
正在安装 : 1:skopeo-containers-0.1.18-1.el7.x86_64 5/7
正在安装 : 2:container-selinux-2.9-4.el7.noarch 6/7
正在安装 : 2:docker-1.12.6-11.el7.centos.x86_64 7/7
验证中 : 2:container-selinux-2.9-4.el7.noarch 1/7
验证中 : 2:docker-1.12.6-11.el7.centos.x86_64 2/7
验证中 : 1:skopeo-containers-0.1.18-1.el7.x86_64 3/7
验证中 : 1:oci-register-machine-0-1.11.gitdd0daef.el7.x86_64 4/7
验证中 : 2:docker-common-1.12.6-11.el7.centos.x86_64 5/7
验证中 : 2:docker-client-1.12.6-11.el7.centos.x86_64 6/7
验证中 : 1:oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64 7/7

已安装:
docker.x86_64 2:1.12.6-11.el7.centos

作为依赖被安装:
container-selinux.noarch 2:2.9-4.el7 docker-client.x86_64 2:1.12.6-11.el7.centos docker-common.x86_64 2:1.12.6-11.el7.centos
oci-register-machine.x86_64 1:0-1.11.gitdd0daef.el7 oci-systemd-hook.x86_64 1:0.1.4-9.git671c428.el7 skopeo-containers.x86_64 1:0.1.18-1.el7

完毕!

启动 docker,执行:
[root@localhost frinder]# systemctl start docker.service

将 docker设置开机启动:
[root@localhost frinder]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

下载 docker使用 Centos镜像,下载有点慢,耐心等待:
[root@localhost docker]# docker pull centos
Using default tag: latest
Trying to pull repository docker.io/library/centos ...
latest: Pulling from docker.io/library/centos
93857f76ae30: Pull complete
Digest: sha256:4eda692c08e0a065ae91d74e82fff4af3da307b4341ad61fa61771cc4659af60

查看下载镜像:
[root@localhost docker]# docker images centos
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos latest a8493f5f50ff 3 days ago 192.5 MB

使用 docker启动一个容器,启动成功会自动切换到临时容器 54d23ded3cd1:
[root@localhost docker]# docker run -i -t docker.io/centos /bin/bash
[root@54d23ded3cd1 /]#

[root@54d23ded3cd1 /]# ls /etc
BUILDTIME chkconfig.d gnupg issue.net modules-load.d popt.d rc5.d shells virc
DIR_COLORS crypttab group krb5.conf motd prelink.conf.d rc6.d skel xdg
DIR_COLORS.256color csh.cshrc group- krb5.conf.d mtab printcap redhat-release ssl xinetd.d
DIR_COLORS.lightbgcolor csh.login gshadow ld.so.cache nsswitch.conf profile resolv.conf subgid yum
GREP_COLORS dbus-1 gshadow- ld.so.conf nsswitch.conf.bak profile.d rpc subuid yum.conf
X11 default gss ld.so.conf.d openldap protocols rpm sysconfig yum.repos.d
adjtime.rpmsave depmod.d host.conf libaudit.conf opt python rsyslog.d sysctl.d
aliases dracut.conf hostname libuser.conf os-release rc.d sasl2 system-release
alternatives dracut.conf.d hosts locale.conf pam.d rc.local securetty system-release-cpe
bash_completion.d environment hosts.allow localtime passwd rc0.d security systemd
bashrc exports hosts.deny login.defs passwd- rc1.d selinux terminfo
binfmt.d filesystems init.d logrotate.d pkcs11 rc2.d services tmpfiles.d
centos-release fstab inputrc machine-id pki rc3.d shadow udev
centos-release-upstream gcrypt issue modprobe.d pm rc4.d shadow- vconsole.conf
[root@54d23ded3cd1 /]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@54d23ded3cd1 /]# exit

centos7安装 docker的更多相关文章

  1. Centos7安装Docker 基于Dockerfile 搭建httpd运行环境

    Centos7安装Docker 基于Dockerfile 搭建httpd运行环境 docker docker搭建 docker build 本文档完成目标内容如下 使用Docker搭建http服务器一 ...

  2. 【运维技术】VM虚拟机上使用centos7安装docker启动gogs服务教程【含B站视频教程】

    VM虚拟机上使用centos7安装docker启动gogs服务视频教程 BiliBili视频教程链接飞机票,点我 使用VMware Workstation安装Centos7 MinMal系统 第一步: ...

  3. centos install docker setup centos7 安装docker

    centos7 安装docker 1: 安装必要的一些系统工具sudo yum install -y yum-utils device-mapper-persistent-data lvm2 2: 添 ...

  4. 获取Centos7安装Docker各种姿势(指定版本)(转载)

    Centos7安装docker社区(CE)版 官网指导:https://docs.docker.com/engine/installation/linux/docker-ce/centos/#inst ...

  5. CentOS7安装docker 18.06

    原文:CentOS7安装docker 18.06 一.CentOS Docker 安装 参考docker 官方网站:https://docs.docker.com/install/linux/dock ...

  6. centos7 安装docker(手动和脚本安装)换源 卸载

    centos7 安装docker(手动和脚本安装)换源 卸载 Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker ...

  7. Docker学习笔记(1):CentOS7安装Docker

    Docker是一个基于Go语言实现的开源应用容器引擎,通过对应用组件的封装.分发.部署.运行等生命周期的管理,使程序及其运行环境能够做到"一次封装,到处运行". Docker架构 ...

  8. 【Docker】 CentOS7 安装 Docker 及其使用方法 ( 一 )

    系列目录: [Docker] CentOS7 安装 Docker 及其使用方法 ( 一 ) [Docker] 使用Docker 在阿里云 Centos7 部署 MySQL 和 Redis (二) [D ...

  9. centos7安装docker、docker-compose、es7.3.0、kibana7.3.0

    一.安装docker 1.更新yum包 sudo yum update 2.卸载旧版本(如果安装过旧版本的话) sudo yum remove docker docker-common docker- ...

随机推荐

  1. Haskell语言学习笔记(26)Identity, IdentityT

    Identity Monad newtype Identity a = Identity { runIdentity :: a } instance Functor Identity where fm ...

  2. 软件工程导论复习 如何画系统流程图和数据流图 part2

    数据流图(DFD)    数据流图,简称DFD,是SA方法中用于表示系统逻辑模型的一种工具,它以图形的方式描绘数据在系统中流动和处理的过程,由于它只反映系统必须完成的逻辑功能,所以它是一种功能模型.下 ...

  3. 吴裕雄 实战PYTHON编程(5)

    text = '中华'print(type(text))#<class 'str'>text1 = text.encode('gbk')print(type(text1))#<cla ...

  4. 吴裕雄 数据挖掘与分析案例实战(4)——python数据处理工具:Pandas

    # 导入模块import pandas as pdimport numpy as np # 构造序列gdp1 = pd.Series([2.8,3.01,8.99,8.59,5.18])print(g ...

  5. c# 结构体 集合 复习

    添加5个学生的信息到集合中,每个学生都有:学号,姓名,成绩,3个内容,添加完毕后将学生的分数从高到低排列并打印出来,使用结构体 using System; using System.Collectio ...

  6. lrzsz的安装与配置

    1)下载http://freshmeat.sourceforge.net/projects/lrzsz/ 2)tar zxvf lrzsz-0.12.20.tar.gz 3)mv lrzsz-0.12 ...

  7. Cannot create inner bean '(inner bean)#67f903b5' of typ

    严重: Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error crea ...

  8. 自己整理lnmp安装

    1. 操作系统   CentOS release 6.5(final)   2. 安装mysql   # yum install mysql-server   #vi /etc/my.cnf +def ...

  9. Request method 'GET' not supported

    Request method 'GET' not supported 错误原因: GET请求不被允许. 解决方法: 1.从客户端入手.假设浏览器中的js用了ajax发起异步请求GET,将GET改为PO ...

  10. LibreOJ 6277 数列分块入门 1(分块)

    题解:感谢hzwer学长和loj让本蒟蒻能够找到如此合适的入门题做. 这是一道非常标准的分块模板题,本来用打标记的线段树不知道要写多少行,但是分块只有这么几行,极其高妙. 代码如下: #include ...