ubuntu之docker安装

1、安装环境

ubuntu 16.04

docker-ce 18

2、安装文档

https://docs.docker.com/install/linux/docker-ce/ubuntu/

3、安装命令

sudo apt-get update

sudo apt-get install \
     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] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \
     stable"

sudo apt-get update

sudo apt-get install docker-ce

sudo docker run hello-world

4、问题记录

  • unable to resolve host[hostnane]
sudo vim /etc/hosts

在127.0.0.1 localhost下一行加上  127.0.0.1  [your hostname]

  • 免sudo命令方法
sudo groupadd docker

sudo gpasswd -a ${USER} docker

sudo service docker restart

newgrp - docker

猜你喜欢

转载自blog.csdn.net/jinyidong/article/details/81558574