安裝
設置阿里源 :
設備repos源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum list docker --showduplicates | sort -r
安裝
yum install docker.x86_64
啓動
service docker start
網易鏡像庫
https://c.163.com/hub#/m/library/
阿里鏡像庫
https://dev.aliyun.com/search.html
進入腳本
#!/bin/bash
CNAME=$1
CPID=$(docker inspect --format "{{.State.Pid}}" $CNAME)
nsenter --target "$CPID" --mount --uts --ipc --net --pid
查看日誌
docker logs -f -t --since="2017-05-31" --tail=10 edu_web_1
--since : 此參數指定了輸出日誌開始日期,即只輸出指定日期之後的日誌。
-f : 查看實時日誌
-t : 查看日誌產生的日期
-tail=10 : 查看最後的10條日誌。
edu_web_1 : 容器名稱