码迷,mamicode.com
首页 > 其他好文 > 详细

解决centos7 docker1.9 没有配置文件

时间:2015-12-22 19:37:48      阅读:1472      评论:0      收藏:0      [点我收藏+]

标签:配置文件   system   

如果没有/etc/sysconfig/docker这个配置文件

1.vim  /lib/systemd/system/docker.service  

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket


[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/docker
ExecStart=/usr/bin/docker -d $OPTIONS -H fd://
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
MountFlags=slave

[Install]
WantedBy=multi-user.target

2.vim /etc/sysconfig/docker 

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS=‘-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock‘
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 registry.access.redhat.com‘

# 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 dl.dockerpool.com:5000‘

# 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

3.重启docker

systemctl daemon-reload
systemctl restart docker


本文出自 “翟军铭的linux博客” 博客,请务必保留此出处http://zhaijunming5.blog.51cto.com/10668883/1727303

解决centos7 docker1.9 没有配置文件

标签:配置文件   system   

原文地址:http://zhaijunming5.blog.51cto.com/10668883/1727303

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!