Ubuntu安裝docker教程


官方教程

這里給出我的安裝配置過程,使用阿里源安裝。
1.卸載舊版本

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

如果存在舊版本,我們需要使用該命令卸載它,不存在也沒有關系,只是會報告沒有安裝這些軟件包。
2.安裝一些必要的系統工具

sudo apt-get update #獲取軟件最新源
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

3.安裝GPG證書

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

在這里插入圖片描述
4.寫入軟件源信息

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

在這里插入圖片描述
5.更新並安裝docker引擎

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

如果需要安裝特定的docker版本,可以參照官網。

6.測試是否安裝成功

sudo docker run hello-world

在這里插入圖片描述
如上則說明安裝成功。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM