docker-compose


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.

Related Links

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

Categories

HOME
spring-boot
gcc
algolia
macros
netty
jenkins-pipeline
file-upload
ibm
stdout
mingw
sugarcrm
rethinkdb
sahi
subprocess
ethereum
suitecrm
email-attachments
eclipse-orion
continuous-fourier
bytebuffer
kundera
semantic-ui-react
2checkout
unity3d-5
ports
flickr
geocomplete
device-driver
stochastic-process
client-server
iterm2
lex
mediastream
server-side-swift
redbean
flume-ng
web-technologies
amazon-rds-aurora
scrapinghub
ionic2-select
dotnet-cli
playframework-1.x
xamarin-test-cloud
ios-keyboard-extension
suitesparse
recursive-query
firebase-polymer
scikit-image
change-password
window.location
custom-build-step
video-embedding
cascading
tvp
taverna
random-sample
android-togglebutton
traminer
jsoncpp
ultraedit
service-broker
static-files
pysvn
qf-test
novell
mvcgrid
cs193p
debuggervisualizer
dateadd
webshim
farpoint-spread
class-library
html5-filesystem
flask-mongoengine
autofilter
misfire-instruction
nsnumber
mysql2
cloudmade
blotter
boost.build
django-tinymce
cron4j
quit
motordriver
states
unordered-set
advanceddatagrid
automapper-2
discussion-board
peoplepicker
auto-compile
nstoolbar
data-formats
djangoappengine
ffdshow
content-delivery-network

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App