I have the following folder structure:
my_package
|- docker_compose.yml
|- a
|- Dockerfile
|- b
|- Dockerfile
Here, my docker-compose.yml is:
version: '2'
services:
a:
build:
context: a
dockerfile: Dockerfile
b:
build:
context: b
dockerfile: Dockerfile
When I run docker-compose build I expect two output images, one for a and one for b.
Here's a/Dockerfile
FROM ubuntu
RUN touch AAA
Here's b/Dockerfile
FROM <a> # NOT SURE WHAT TO PUT HERE
RUN touch BBB
I would like the b image to contain two files in the rootdir, AAA and BBB, which requires one Dockerfile to depend on another.
Is this possible? Is there any workaround to make two Docker images (with a dependency between them) build in one docker-compose build command?
I'm stuck with Docker version 1.12.6, build 78d1802 (which is compatible with version 2 syntax only).