如何使用docker-compose并行构建docker镜像?

时间:2019-12-12 13:59:00

标签: docker docker-compose

我有以下docker-compose:

version: "3.7"

services:
  base:
    build:
      context: .
      dockerfile: ./dockerfiles/Dockerfile
    image: myapp/php7.0.8
    volumes:
      - "./www:/var/www/html"


  develop:
    build:
      context: .
      dockerfile: ./dockerfiles/Dockerfile_develop
    image: myapp/php7.0.8-dev
    volumes:
      - "./www:/var/www/html"

  nginx:
    image: nginx:alpine
    ports:
      - 7880:7880
      - 7881:7881
    links:
      - "develop:develop"
      - "base:base"
    volumes:
      - "./www:/var/www/html"
      - "./dist/nginx.conf:/etc/nginx/nginx.conf:ro"

正在构建每个docker映像。 developbase都具有独立的依赖关系而彼此不依赖。那么,如何使用docker-compose来并行构建basedevelop来加快进程?

0 个答案:

没有答案