docker安裝:
????1下載:
????????https://get.docker.com/builds/Linux/x86_64/docker-1.12.3.tgz
????2解壓并查看docker版本:
????????補(bǔ)充: --strip-components N? ?去除N層目錄結(jié)構(gòu)? ?-C指定解壓位置?
????3 在防火墻上打開docker對應(yīng)端口,(明哥不確定這一步需不需要,這里先略過嗡贺。后面我還會再回來的)
????4啟動docker
????5這里需要有一個(gè)開機(jī)自啟動的腳本(這個(gè)shell腳本是我復(fù)制過來的,實(shí)際上只運(yùn)行到第四步即可)
????????1編寫開機(jī)啟動腳本
????????????vi /usr/lib/systemd/system/docker.service
????????????????[Unit]
????????????????Description=Docker Application Container Engine
????????????????Documentation=https://docs.docker.com
????????????????After=network.target
????????????????[Service]
????????????????Type=notify
????????????????# the default is not to use systemd for cgroups because the delegate issues still
????????????????# exists and systemd currently does not support the cgroup feature set required
????????????????# for containers run by docker
????????????????ExecStart=/usr/local/bin/dockerd
????????????????ExecReload=/bin/kill -s HUP $MAINPID
????????????????# Having non-zero Limit*s causes performance problems due to accounting overhead
????????????????# in the kernel. We recommend using cgroups to do container-local accounting.
????????????????LimitNOFILE=infinity
????????????????LimitNPROC=infinity
????????????????LimitCORE=infinity
????????????????# Uncomment TasksMax if your systemd version supports it.
????????????????# Only systemd 226 and above support this version.
????????????????#TasksMax=infinity
????????????????TimeoutStartSec=0
????????????????# set delegate yes so that systemd does not reset the cgroups of docker containers
????????????????Delegate=yes
????????????????# kill only the docker process, not all processes in the cgroup
????????????????KillMode=process
????????????????[Install]
????????????????WantedBy=multi-user.target
????????2設(shè)置開機(jī)啟動
????????????????systemctl enable docker.service
????????3重啟服務(wù)器
? ? ? ? ? ? ? ? reboot