ubuntu 16.04安装docker

安装命令

sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update && sudo apt-get install -y docker-ce

启动与停止

安装完成Docker后,默认已经启动了docker服务,如需手动控制docker服务的启停,可执行如下命令:

启动docker

sudo service docker start

停止docker

sudo service docker stop

重启docker

sudo service docker restart

镜像加速

sudo mkdir -p /etc/docker 
sudo vi /etc/docker/daemon.json

{
  "registry-mirrors": ["https://epsax6ut.mirror.aliyuncs.com"],
  "log-driver":"json-file",
  "log-opts": {"max-size":"10m", "max-file":"3"}
}


重新加载

sudo systemctl daemon-reload
sudo systemctl restart docker

你可能感兴趣的:(docker,ubuntu,容器)