`

Ubuntu安装docker

 
阅读更多
#更新Ubuntu
sudo apt-get update
sudo apt-get dist-upgrade
#安装curl
sudo apt install curl
sudo apt-get remove docker docker-engine
sudo apt-get -y install \
    linux-image-extra-$(uname -r) \
    linux-image-extra-virtual
    apt-transport-https \
    ca-certificates \
    software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"
sudo apt-get -y install docker-ce
apt-cache madison docker-ce
docker -v
Docker version 17.03.1-ce, build c6d412e
sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              48b5124b2768        3 months ago        1.84 kB
sudo systemctl start docker #启动docker
sudo service docker status  #状态
sudo service docker start   #启动
sudo service docker stop    #关闭
sudo service docker restart #重启
sudo docker ps -a           #show all containers on the system
sudo docker run docker/whalesay cowsay boo  #Run the whalesay image
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics