HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Is it possible to build docker images using docker-compose concurrently?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
dockerpossibleusingcomposeimagesbuildconcurrently

Problem

When one runs docker-compose up --build then the docker images are created sequential. Is it possible to build these images concurrently using docker-compose?

There are multiple issues including this, but it is unclear whether it is possible or not.

Solution

Yes, it's possible. You can use --parallel option since docker-composer 1.23.2 version.

Version 1.23.2 also correct 1.23.0 bug:


Reverted a 1.23.0 change that appended random strings to container
names created by docker-compose up, causing addressability issues.
Note: Containers created by docker-compose run will continue to use
randomly generated names to avoid collisions during parallel runs.

https://github.com/docker/compose/releases/tag/1.23.2

You can use it simply doing:

docker-compose build --parallel

Code Snippets

docker-compose build --parallel

Context

StackExchange DevOps Q#1343, answer score: 10

Revisions (0)

No revisions yet.