欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

安装docker-compose

程序员文章站 2022-05-14 22:55:36
...

官网地址: https://docs.docker.com/compose/completion/#install-command-completion

1. Run this command to download the latest version of Docker Compos


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

 

2. Apply executable permissions to the binary:


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

 

3. Test the installation


docker-compose --version

 

4. Uninstallation

To uninstall Docker Compose if you installed using curl:


sudo rm /usr/local/bin/docker-compose

 

docker-compose.yaml


version: '3'
services:
  eurake:
    image: "192.168.1.168:5000/eurake:1.0.2"
    ports:
      - "11000:11000"

 

同个服务,多个实例,这里服务名称要区分下,比如eurake0,eurake1


version: '3'
services:
  #eurake:
   # build: /jar
   # ports:
    # - "11000:11000"
  eurake0:
    image: "192.168.1.168:5000/eurake:1.0.2"
    ports:
      - "11000:11000"
  eurake1:
    image: "192.168.1.168:5000/eurake:1.0.2"
    ports:
      - "11001:11000"

 

 

5. 启动


docker-compose up

 

6.关闭 If you started Compose with docker-compose up -d, stop your services once you’ve finished with them:


docker-compose stop

 

看启动


docker-compose ps

看日志


docker-compose logs