解决centos7 docker1.9 没有配置文件
如果没有/etc/sysconfig/docker这个配置文件 1.vim /lib/systemd/system/docker.service [Unit] Description=DockerApplicationContainerEngine Documentation=https://docs.docker.com After=network.targetdocker.socket Requires=docker.socket [Service] Type=notify EnvironmentFile=/etc/sysconfig/docker ExecStart=/usr/bin/docker-d$OPTIONS-Hfd:// LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity MountFlags=slave [Install] WantedBy=multi-user.target 2.vim /etc/sysconfig/docker #/etc/sysconfig/docker #Modifytheseoptionsifyouwanttochangethewaythedockerdaemonruns OPTIONS='-Htcp://0.0.0.0:4243-Hunix:///var/run/docker.sock' DOCKER_CERT_PATH=/etc/docker #Ifyouwanttoaddyourownregistrytobeusedfordockersearchanddocker #pullusetheADD_REGISTRYoptiontolistasetofregistries,eachprepended #with--add-registryflag.Thefirstregistryaddedwillbethefirstregistry #searched. #ADD_REGISTRY='--add-registryregistry.access.redhat.com' #Ifyouwanttoblockregistriesfrombeingused,uncommenttheBLOCK_REGISTRY #optionandgiveitasetofregistries,eachprependedwith--block-registry #flag.Forexampleaddingdocker.iowillstopusersfromdownloadingimages #fromdocker.io #BLOCK_REGISTRY='--block-registry' #Ifyouhavearegistrysecuredwithhttpsbutdonothavepropercerts #distributed,youcantelldockertonotlookforfullauthorizationby #addingtheregistrytotheINSECURE_REGISTRYlineanduncommentingit. INSECURE_REGISTRY='--insecure-registrydl.dockerpool.com:5000' #OnanSELinuxsystem,ifyouremovethe--selinux-enabledoption,you #alsoneedtoturnonthedocker_transition_unconfinedboolean. #setsebool-Pdocker_transition_unconfined1 #Locationusedfortemporaryfiles,suchasthosecreatedby #dockerloadandbuildoperations.Defaultis/var/lib/docker/tmp #Canbeoverridenbysettingthefollowingenvironmentvariable. #DOCKER_TMPDIR=/var/tmp #Controlsthe/etc/cron.daily/docker-logrotatecronjobstatus. #Todisable,uncommentthelinebelow. #LOGROTATE=false 3.重启docker systemctldaemon-reload systemctlrestartdocker