Build multiple images with Docker Compose?
I have a repository which builds three different images: powerpy-base powerpy-web powerpy-worker Both powerpy-web and powerpy-worker inherit from powerpy-base using the FROM keyword in their Dockerfile. I'm using Docker Compose in the project to run a Redis and RabbitMQ container. Is there a way for me to tell Docker Compose that I'd like to build the base image first and then the web and worker images?
You can use depends_on to enforce an order, however that order will also be applied during "runtime" (docker-compose up), which may not be correct. If you're only using compose to build images it should be fine. You could also split it into two compose files. a docker-compose.build.yml which has depends_on for build, and a separate one for running the images as services. These is a related issue: https://github.com/docker/compose/issues/295
About run containers: It was bug before, but they fixed it since docker-compose v1.10. https://blog.docker.com/2016/02/docker-1-10/ Start linked containers in correct order when restarting daemon: This is a little thing, but if you’ve run into it you’ll know what a headache it is. If you restarted a daemon with linked containers, they sometimes failed to start up if the linked containers weren’t running yet. Engine will now attempt to start up containers in the correct order. About build: You need to build base image first.
use nvidia-docker-compose launch a container, but exited soon
Why doesn't docker-compose 'down' take an optional [SERVICE…] argument?
why does docker-compose build trigger a rebuild when nothing changed
Disable autostart of docker-compose project
Docker-compose Error-Mean Stack Application won't get loaded with the data from mongodb container
docker-compose Windows volume
Trying to figure out why eslint-watch doesn't work with docker-compose correctly
docker-compose the latest stable version on ubuntu
docker compose environment variable for command
java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3
What does working_dir tag mean in a docker-compose yml file
If I upgrade an image in docker-compose, will its volumes be lost?
How to solve this docker-compose upgrading error?
Fabric Network - what happens when a downed peer connects back to the network?
Docker-compose and load balancing
Run arguments in Docker Compose