Ubuntu 16.04 Docker-ce 安裝

ubuntu 16.04

參考頁:https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

安裝相關工具

1
2
3
4
5
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

GPG key

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

增加來源

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

安裝

1
2
sudo apt-get update
sudo apt-get install docker-ce

要操作的user帳號,加入docker群組

1
sudo usermod -a -G docker <帳號>

安裝 docker compose

1
2
sudo curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose