• 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. avalon的常见问题

    随着avalon的普及,越来越多人加入avalon的大家庭.随之而来的是各种问题.本文在这里统一解答一下. 使用avalon基本上有几个方针要坚持 数据必须先定义后使用,只能VM中定义,不能V中定义. ...

  2. ibernate 配置数据库方言

          在开发hibernate的程序时,需要进行SessionFactory的配置,简单地说,也就是建立与数据库之间连接的配置,在hibernate中一般使用xml文件来进行配置,但是在该文件的 ...

  3. Windows自带的端口转发工具netsh使用方法_DOS/BAT

    Windows自带的端口转发工具netsh使用方法_DOS/BAT   作者:用户 来源:互联网 时间:2017-02-22 17:24:30 netsh 端口转发 摘要: 下面的代码在windows ...

  4. drupal 7.1 doc

    https://www.drupal.org/docs/8/api/database-api/dynamic-queries/count-queries https://www.drupal.org/ ...

  5. 安装和使用iOS的包管理工具CocoaPods

    CocoaPods是ruby实现的,需要用ruby进行安装,mac自带ruby,如果没有ruby的需要先安装ruby.   安装CocoaPods命令 安装CocoaPods命令:sudo gem i ...

  6. Python3 bytes 函数

    Python3 bytes 函数  Python3 内置函数 描述 bytes 函数返回一个新的 bytes 对象,该对象是一个 0 <= x < 256 区间内的整数不可变序列.它是 b ...

  7. swift UITextfield 添加点击方法 - 简单实现

    1. 真正在任何系统上都有效的方法 1./// 城市选择 private lazy var cityTextfield:UITextField = { let tf = UITextField() t ...

  8. Java中spring读取配置文件的几种方法

    Spring读取配置XML文件分三步: 一.新建一个Java Bean: package springdemo; public class HelloBean { private String hel ...

  9. Git Submodule 使用简介

    参考http://www.diguage.com/archives/146.html 一.添加子模块 从新建一个项目,或者从远处服务器上克隆一个项目,作为“顶级项目”.这里,从 Github 上新建一 ...

  10. cmake 总结

    cmake中一些预定义变量 PROJECT_SOURCE_DIR 工程的根目录 PROJECT_BINARY_DIR 运行cmake命令的目录,通常是${PROJECT_SOURCE_DIR}/bui ...