本安裝文檔參考官方文檔編寫,如安裝過程中存在問題可參考原版安裝教程
https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository本次安裝環境為Ubuntu18.04 x86-64
初始驗證:
(1)驗證是否安裝了curl
$ which curl
備注:如果沒有安裝則進行安裝,具體安裝如下:
$ sudo apt-get update
$ sudo apt-get install curl
一、在Ubuntu中建立ce存儲庫
第一步:安裝軟體包以允許apt通過HTTPS使用存儲庫:
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
第二步:添加Docker的官方GPG密鑰:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
備注:可使用以下指令進行驗證秘鑰指紋 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
$ sudo apt-key fingerprint 0EBFCD88
第三步:可選設定穩定存儲庫,可不設定,則自動使用(deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable)
注:官方文檔提到在此處設定時,如果是在linux mint下,則需要設定父級Ubuntu發行版的名稱。Linux Mint Rafaela、Ubunut版本直接使用 lsb_release -cs指令擷取到的名稱即可
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
第四步,更新apt資源包,并進行安裝docker ce
$ sudo apt-get update
$ sudo apt-get -y install docker-ce
備注:如果需要安裝特定版本,則使用以下指令擷取可用的版本号,使用要安裝的版本号進行安裝
apt-cache madison docker-ce
sudo apt-get install -y docker-ce=<VERSION>
例如:docker-ce=18.03.0~ce-0~ubuntu
第五步,基礎安裝完成,可以先進行測試一下是否可用
$ sudo docker version
$ sudo docker run hello-world
如果執行時不想使用sudo指令,可以進行設定使用者組,并将目前使用者增加到該組中
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
登出一下,再執行以下指令
$ docker run hello-world
備注:文中提到的網站牆内有時通路不到,可以在GitHub[
https://github.com/getlantern/forum]上面下載下傳一個lantern出牆通路。
可用激活碼 YPDTQ9Y 進行激活使用藍燈專業版三個月