Ubuntu上安装Docker和Docker Compose

Ubuntu版本
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

安装Docker

$ sudo apt-get update
$ sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK

$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) [email protected]
sub rsa4096 2017-02-22 [S]

$ sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

$ sudo apt search docker-ce | grep docker-ce
docker-ce/bionic 18.06.1ce3-0~ubuntu amd64

$ sudo apt install -y docker-ce

安装Docker Compose

# sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# sudo chmod +x /usr/local/bin/docker-compose

# docker-compose version

Ubuntu上安装Docker和Docker Compose_第1张图片

 

你可能感兴趣的:(Docker)