1. 安裝 docker
$ sudo apt-get remove docker docker-engine docker.io
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce –y
官方安裝文檔:
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1
2. 安裝 docker-compose
下載 docker-compose-Linux-x86_64狮惜,地址:
https://github.com/docker/compose/releases
把 docker-compose-Linux-x86_64 放到 /usr/local/bin
下,并改名為 docker-compose
添加執(zhí)行權(quán)限
chmod +x /usr/local/bin/docker-compose
驗(yàn)證
docker-compose version