Docker-compose is a tool that is able to run multiple container by issuing docker-compose up. One of the features is that DNS mappings could be made between the containers so that they can find each other.
Questions tagged [docker-compose]
258 questions
43
votes
3 answers
Why is one not allowed to use a Boolean in a docker-compose.yml?
Defining a boolean in a docker-compose.yml file:
environment:
SOME_VAR: true
and running docker up results in:
contains true, which is an invalid type, it should be a string, number, or a null
Attempts to solve the issue
If true is changed to…
030
- 13,235
- 16
- 74
- 173
12
votes
2 answers
Is it possible to build docker images using docker-compose concurrently?
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.
030
- 13,235
- 16
- 74
- 173
6
votes
1 answer
How to create replicas in docker-compose when `scale` is deprecated?
According to docker-compose issue #5586, scale is deprecated. The replacement is deploy.replicas but that latter is not handled by docker-compose, only by docker stack implying you have to run Docker in swarm mode.
As alternate solutions, you can…
Sylvain Leroux
- 1,550
- 1
- 13
- 25
6
votes
1 answer
What are best practices to override complete sections using docker-compose?
The docker-compose.override contains:
volumes:
- ./a:/path/to/a
The docker-compose:
volumes:
- a:/path/to/a
When docker-compose up is run the override overwrite the ./a overwrites the a.
When a new volume is added to docker-compose, the…
030
- 13,235
- 16
- 74
- 173
3
votes
2 answers
Dynamic YAMLs for Docker Compose
Currently I find myself managing a set of embarassingly similar YAMLs for environment profiles. I see there a scaling trouble if there will be lots of dynamic environments (i.e. fluid acceptance test configurations, with disposable environments you…
Ta Mu
- 6,772
- 5
- 39
- 82
3
votes
1 answer
How to create a database backup using docker-compose
According to this documentation one could create a database backup
docker-compose.admin.yml
version: '3'
services:
dbadmin:
build: db_data/
links:
- db
running
docker-compose -f docker-compose.yml -f docker-compose.admin.yml \
run…
030
- 13,235
- 16
- 74
- 173
2
votes
2 answers
docker-compose local variable declare and use
In the programming language we can define and declare a variable and use it later in the program, can we do same in docker-compose file?
For example in Java:
int x = 100;
System.out.println("Number is: "+ x);
Similarly, in docker-compose file,…
Nigam Rout
- 23
- 1
- 4
2
votes
1 answer
Error with docker-compose - image not supported?
What's wrong with the following spec? (Image parameter is here to tag resulting image).
version: '3'
services:
foo:
build:
image: foo/bar
dockerfile: Dockerfile
context: .
System output:
services.foo.build…
Ta Mu
- 6,772
- 5
- 39
- 82
2
votes
0 answers
How to add to a list for a Docker yaml extension
Is there a way with docker-compose to allow extension fields to add fields to a list?
I've tried a whole bunch of combinations, but haven't seen if there's a way to do this
What I want to do is have a set list of volumes (in a list) and then a few…
Peter Turner
- 1,430
- 4
- 17
- 35
1
vote
2 answers
How to pass the version to docker-compose?
When I would like to update an app at the moment, docker-compose down, the version in the docker-compose.yaml is changed, subsequently the app is started and the latest version is running.
Now I would like to update it automatically. It it possible…
030
- 13,235
- 16
- 74
- 173
1
vote
1 answer
Why is my docker composer volume not working?
My volume isn't being created with the containers, this volume binds with the host, every time I try to attempt to run it or go to an online validator for yaml, it shows the correct validation on the validator but fails to run:
ERROR: In file…
user36023
- 11
- 3
1
vote
1 answer
Docker compose scale, what is it good for?
I have a docker-compose with 4 containers deployed in production.
I wanted to use docker scale for the nodejs part. (with nginx LB)
If the docker-compose scale is done on the host machine, how does it suppose to improve performance, I did not limit…
SexyMF
- 113
- 3
0
votes
1 answer
Error when renaming docker-compose service
I'm new to docker-compose but my intuition is that it should not matter at all how a service is named, like a variable in a programming language. Is that correct and is there some obscure bug or is there some magic in the background that I don't…
Konrad Höffner
- 63
- 7
0
votes
1 answer
Docker-compose containers can't connect to each other
According to the Docker Compose Docs: Networking:
By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them…
ki9
- 103
- 1
- 5