CentOS7.2 安装Docker
Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。
通过 uname -r 命令查看你当前的内核版本
[root@localhost /]# uname -r
3.10.-.el7.x86_64
Docker 软件包和依赖包已经包含在默认的 CentOS-Extras 软件源里,安装命令如下:
yum -y install docker
启动docker:
[root@localhost /]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
查看具体错误信息:
[root@localhost /]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 五 -- :: CST; 3min 57s ago
Docs: http://docs.docker.com
Process: ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=/FAILURE)
Main PID: (code=exited, status=/FAILURE) 4月 :: localhost.localdomain systemd[]: Starting Docker Application Container Engine...
4月 :: localhost.localdomain dockerd-current[]: time="2018-04-20T06:50:50.921964698+08:00" level=warning msg="could not ...ound"
4月 :: localhost.localdomain dockerd-current[]: time="2018-04-20T06:50:50.927241794+08:00" level=info msg="libcontainerd...4010"
4月 :: localhost.localdomain dockerd-current[]: time="2018-04-20T06:50:51.936045098+08:00" level=warning msg="overlay2: the b...
4月 :: localhost.localdomain dockerd-current[]: Error starting daemon: SELinux is not supported with the overlay2 graph ...alse)
4月 :: localhost.localdomain systemd[]: docker.service: main process exited, code=exited, status=/FAILURE
4月 :: localhost.localdomain systemd[]: Failed to start Docker Application Container Engine.
4月 :: localhost.localdomain systemd[]: Unit docker.service entered failed state.
4月 :: localhost.localdomain systemd[]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
可以看出错误信息
Error starting daemon: SELinux is not supported with the overlay2 graph ...alse)
此linux的内核中的SELinux不支持 overlay2 graph driver ,解决方法有两个,要么启动一个新内核,要么就在docker里禁用selinux,--selinux-enabled=false
[root@localhost /]# vi /etc/sysconfig/docker
修改配置:
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
DOCKER_CERT_PATH=/etc/docker
fi # Do not add registries in this file anymore. Use /etc/containers/registries.conf
# from the atomic-registries package.
#
在--selinux-enabled后面添加=false即可!
重新启动docker
[root@localhost /]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost /]# docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 1.13.
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: false
Native Overlay Diff: false
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Init Binary: docker-init
containerd version: (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: N/A (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
WARNING: You're not using the default seccomp profile
Profile: /etc/docker/seccomp.json
Kernel Version: 3.10.-.el7.x86_64
Operating System: CentOS Linux (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks:
CPUs:
Total Memory: 977.9 MiB
Name: localhost.localdomain
ID: 2QP3:PYDM:BLLS:P5QS:QGJN:N7GK:DAKV:ZWFG:FW54:FHS4:FCAN:6NR4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Experimental: false
Insecure Registries:
127.0.0.0/
Live Restore Enabled: false
Registries: docker.io (secure)
测试运行hello-world
[root@localhost /]# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
/usr/bin/docker-current: Get https://registry-1.docker.io/v2/library/hello-world/manifests/sha256:d5c74e6f8efc7bdf42a5e22bd764400692cf82360d86b8c587a7584b03f51520: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: net/http: request canceled (Client.Timeout exceeded while awaiting headers).
See '/usr/bin/docker-current run --help'.
[root@localhost /]# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
9bb5a5d4561a: Pull complete
Digest: sha256:f5233545e43561214ca4891fd1157e1c3c563316ed8e237750d59bde73361e77
Status: Downloaded newer image for docker.io/hello-world:latest Hello from Docker!
This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps:
. The Docker client contacted the Docker daemon.
. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal. To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
启动重启命令:
[hongdada@localhost home]$ systemctl stop docker.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
[hongdada@localhost home]$ systemctl restart docker.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
[hongdada@localhost home]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since 五 -- :: CST; 12s ago
Docs: http://docs.docker.com
Main PID: (dockerd-current)
CGroup: /system.slice/docker.service
├─ /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-cu...
└─ /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-con...
http://www.runoob.com/docker/centos-docker-install.html
https://www.cnblogs.com/amoyzhu/p/5261393.html
https://blog.csdn.net/11b202/article/details/21389067
http://www.21yunwei.com/archives/4437
CentOS7.2 安装Docker的更多相关文章
- Centos7上安装docker (转)
Centos7上安装docker Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE. 社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如 ...
- docker(一) Centos7下安装docker
docker(一) Centos7下安装dockerdocker(二) windows10下安装dockerdocker(三) 镜像和容器常用命令 docker(四) 使用Dockerfile构建镜像 ...
- CentOS7下安装docker(Docker系列1)
CentOS7下安装docker 系统要求 为了安装docker,需要准备 64-bit的CentOS 7 删除非官方的Docker包 yum的仓库中有一个很旧的Docker包, 现在Docker官方 ...
- centos7上安装docker社区版
container(容器) docker(集装箱) 容器的优点 1. 启动速度快 2. 节省资源 3. 兼容性高 保证机器正常上网 #ping www.baidu.com CPU需要支持虚拟化 # g ...
- centos7下安装docker与镜像加速
1.背景 centos7下安装docker 2.安装 第一步:检查是否为centos7版本 第二步:依赖环境安装 执行如下两个命令: yum -y install gcc yum -y install ...
- centos7.0安装docker报错
使用centos7.0安装dockers时出现Transaction check error错误. yum install docker Transaction check error: file / ...
- Linux(centos7)下安装Docker
近期公司开始推Docker技术.这个系列的文章都是基于CentOS7系统下进行讲解的. Docker简介 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器 ...
- Centos7快速安装docker
偶然间发现,docker的安装好容易啊 系统环境:centos7.3 yum源: docker:https://mirrors.aliyun.com/docker-ce/linux/centos/do ...
- centos7下安装docker(21docker swarm集群创建)
创建swarm集群: 实验环境:盗图 swarm-manager是manager node,swarm-worker1和swarm-worker2是worker node. 所有节点的docker版本 ...
- centos7下安装docker(14安装docker machine)
之前我们做的实验都是在一个host上面的,其实在真正的环境中有多个host,容器在这些host上面启动,运行,停止和销毁,相关容器会通过网络相互通信,无论他们是否运行在相同的host上面. 对于这种歌 ...
随机推荐
- 向量体系结构(2)----SIMD指令集扩展和GPU
进行SIMD多媒体扩展的设计,源于一个很容易观察到的事实: 许多多媒体应用程序操作的数据类型比对32位处理器进行针对性优化的数据类型更窄一些. 图像三基色,都是8位.音频采样也都是8位和16位来表示. ...
- Unity AssetBoundle 打包流程
1.准备打包资源,给要打包的资源添加一个AssetBoundle名字 2.在Scripts文件夹下新建一个子文件夹,命名为Editor(注意名字不能写错),新建一个打包资源的C#类,命名为BuildA ...
- C. Primes or Palindromes?
prime numbers non greater than n is about . We can also found the amount of palindrome numbers with ...
- Linux服务器下jdk 安装与环境变量的配置
1,Oracle 官网下载jdk Linux版本 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...
- 修改 File --> New 菜单内容
修改 File --> New 菜单内容 window --> Perspective --> Customize Perspective
- [资讯] NFC有什么作用。小米手机3NFC解读
在近几年的智能手机市场,NFC成了Android高端手机产品的标准配置,无论是Android还是Windows Phone阵营,有越来越多的厂商也开始为自己的产品加入NFC功能.而小米最新的旗舰产品— ...
- GLSL写vertex shader和fragment shader
0.一般来说vertex shader处理顶点坐标,然后向后传输,经过光栅化之后,传给fragment shader,其负责颜色.纹理.光照等等. 前者处理之后变成裁剪坐标系(三维),光栅化之后一般认 ...
- Inernet TLS协议注册表 开启
IE高级配置中,存在SSL支持协议,例如SSL TLS. 其在注册表的路径为:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\I ...
- SpringMVC实现 MultipartFile 文件上传
1. Maven 工程引入所需要的依赖包 2. 页面需要开放多媒体标签 3. 配置文件上传试图解析器 4. 接收图片信息,通过 IO 流写入磁盘(调用解析其中的方法即可) 如下: 1.1 引入所依赖的 ...
- STM32L476应用开发之六:电池SOC检测(转)
源: STM32L476应用开发之六:电池SOC检测