Ubuntu安裝docker ce

1、Docker學習linux

  1.若是已安裝docker,卸載舊版本docker

    sudo apt-get remove docker docker-engine docker.io containerd runcjson

  2.使用存儲庫安裝ubuntu

    1.更新apt包curl

      sudo apt-get update學習

    2.安裝包容許apt經過HTTPS 使用存儲庫測試

      

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

  3.增長docker官方GPG key:ui

  

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  4.驗證是否安裝好url

    

$ sudo apt-key fingerprint 0EBFCD88
    
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

    5.安裝穩定版本的倉庫(最好copy命令,本身敲可能會出問題)spa

    

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

  6.更新包

    sudo apt-get update

  7.安裝

    sudo apt-get install docker-ce docker-ce-cli containerd.io

  8.安裝好後測試

    sudo docker run hello-world

    若是報找不到image,而且不去拉去。則證實是拉去的是國外的鏡像,須要如下配置。

  9.測試報錯 unable to find image  

    須要建立或修改 /etc/docker/deamon.json

    { "registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"] }

    重啓docker服務,systemctl restart docker

    重啓後,docker run hello-world就能夠用了。

  舒適提醒:本blog只是學習隨筆,如要詳細資料請移至:https://docs.docker.com/install/linux/docker-ce/ubuntu/

相關文章
相關標籤/搜索