我有以下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映像。 develop
和base
都具有独立的依赖关系而彼此不依赖。那么,如何使用docker-compose来并行构建base
和develop
来加快进程?