Ubuntu 安装Docker-Compose

@pfrong  December 14, 2019

介绍

本文安装的系统环境为 Ubuntu 16.04,docker-compose 安装步骤如下

安装教程

1.安装Docker

依次执行以下两条命令安装Docker

$ curl -fsSL get.docker.com -o get-docker.sh
$ sh get-docker.sh

git 为必须安装的环境,安装命令为apt-get -y install git

安装完毕后,运行$ docker run hello-world 验证是否安装成功,看到以下输出则为安装成功

1b930d010525: Pull complete 
Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
......

2.安装Docker-Compose

依次执行

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

$ chmod +x /usr/local/bin/docker-compose

运行 $ docker-compose --version 看到如下输出表示安装成功:

docker-compose version 1.24.1, build 4667896b

到此处安装成功,开始你的docker之旅吧!


添加新评论