Ubuntu 安裝 Docker Engine
本篇文章介紹在 Ubuntu 安裝 Docker,參考官方安裝教學執行
設定儲存庫
更新 apt 套件,並安裝允許透過 HTTPS 使用儲存庫
1
2
3
4
5
6sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release加入 Docker 官方 GPG key
1
2sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg設定儲存庫
1
2
3echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安裝 Docker Engine
更新 apt 套件
1
sudo apt-get update
安裝 Docker Engine、containerd 和 Docker Compose
1
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
使用 hello-world image 驗證成功安裝 Docker Engine
1
sudo docker run hello-world
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.