CentOs 7 server with gui edition 安装 docker

系统:CentOS Linux release 7.0.1406 (Core)   Linux ka207 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

1.常规安装方法

sudo yum install docker
#目前centos软件仓库提供的docker版本为
sudo docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3
Git commit (client): fc0329b/1.5.0
OS/Arch (client): linux/amd64
Server version: 1.5.0-dev
Server API version: 1.18
Go version (server): go1.3.3
Git commit (server): fc0329b/1.5.0
OS/Arch (server): linux/amd64


#安装成功之后需要手动启动docker服务
#centos7 使用systemd管理
systemctl start docker.service

2.遇到问题

# 发现启动失败,现象可以参见 http://stackoverflow.com/questions/27216473/docker-1-3-fails-to-start-on-rhel6-5
# 按照文中的解决办法
sudo yum update -y device-mapper-libs
#升级成功之后再次运行 systemctl start docker.service 即可启动docker守护进程

3.额外配置

docker安装成功之后,还要做以下几个额外i工作

1.添加docker为开机启动

systemctl enable docker.service

2.为了方便私有registry使用,给docker deamon添加参数

sudo vi /etc/sysconfig/docker
#以下是文件内容

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --insecure-registry 10.28.162.206:5000' #此处添加自己的私有registry --insecure-registry 10.28.162.206:5000

DOCKER_CERT_PATH=/etc/docker

# If you want to add your own registry to be used for docker search and docker
# pull use the ADD_REGISTRY option to list a set of registries, each prepended
# with --add-registry flag. The first registry added will be the first registry
# searched.
ADD_REGISTRY='--add-registry 10.28.162.206:5000' #此处添加docker search的的额外私有registry,docker
#serach 的时候会在此库中进行搜索

# If you want to block registries from being used, uncomment the BLOCK_REGISTRY
# option and give it a set of registries, each prepended with --block-registry
# flag. For example adding docker.io will stop users from downloading images
# from docker.io
# BLOCK_REGISTRY='--block-registry'

# If you have a registry secured with https but do not have proper certs
# distributed, you can tell docker to not look for full authorization by
# adding the registry to the INSECURE_REGISTRY line and uncommenting it.
# INSECURE_REGISTRY='--insecure-registry'

# On an SELinux system, if you remove the --selinux-enabled option, you
# also need to turn on the docker_transition_unconfined boolean.
# setsebool -P docker_transition_unconfined 1

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overriden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp

# Controls the /etc/cron.daily/docker-logrotate cron job status.
# To disable, uncomment the line below.
# LOGROTATE=false
#

GOTRACEBACK='crash'

修改完成之后,重启docker服务即可

systemctl restart docker.service

#尝试下载私有registry中的镜像
sudo docker pull 10.28.162.206:5000/bianfeng218/tomcat6

至此,docker安装完毕。



参考文档:

http://stackoverflow.com/questions/27216473/docker-1-3-fails-to-start-on-rhel6-5

wiki.centos.org/Cloud/Docker?highlight=%28docker%29

转载于:https://my.oschina.net/u/152570/blog/398279

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值