Questions tagged [docker-compose]

Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

Docker Compose is an officially supported tool to build multi-container applications. An application author or deployer creates a YAML file, generally named docker-compose.yml, that lists the containers or services that make up the application, along with other Docker-specific resources such as named volumes or containers. Docker Compose supports some features of , though it also works well for single-host Docker installations.

This tag is appropriate for questions about setting up the docker-compose.yml file and other questions about deployment or communication between containers managed by Docker Compose. It may be appropriate to tag your questions as as well. Please include a good extract of the docker-compose.yml file as a code block in your question, enough to reproduce the issue you are asking about.

Remember that questions must be programming-related. Questions on how to install Compose, how to use Compose to manage existing prebuilt images, or how to run someone else's Compose file are not programming-related and are not on topic for Stack Overflow.

Key links:

30464 questions
10
votes
3 answers

Docker-compose: setting hostname equal to its hostname of where the container is running

Right now, I have two-node in swarm cluster $ docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS yey1njv9uz8adf33m7oz0h80f * redis2 Ready Active …
ealeon
  • 12,074
  • 24
  • 92
  • 173
10
votes
3 answers

How to update docker-compose on Docker for Windows?

I've installed Docker for Windows on my machine (Windows 10, Hyper-V). Version is 18.03.0-ce. But the version of docker-compose is 1.20.1. I want to run docker-compose with a docker-compose.yml file containing the property version : '2'. I get the…
Rolf
  • 191
  • 1
  • 4
  • 13
10
votes
1 answer

Attach to container from docker compose restarts container

I have 2 services with 2 different images in my docker-compose.yml, when I run "docker-compose up -d", containers are started properly, but when i try to do "docker attach ", container restarts. Can anyone please explain this behavior. How can…
Srinivasa Prasad
  • 203
  • 1
  • 2
  • 9
10
votes
1 answer

Docker-compose mysql environment difference between PASSWORD and ROOT_PASSWORD

This is from my docker compose: db: image: mysql ports: - "3306:3306" environment: MYSQL_DATABASE: myDb MYSQL_USER: user MYSQL_PASSWORD: test MYSQL_ROOT_PASSWORD:…
helloworld123
  • 155
  • 2
  • 2
  • 8
10
votes
3 answers

Docker: I can't map ports other than 80 to my WordPress container

I want to map some random port on my computer e.g. localhost:7006 to my WordPress docker container's port 80.When I change the port of WordPress from 80:80 to 7006:80 it's not only stops working on localhost(port 80) but also don't respond on…
Junaid Anwar
  • 844
  • 1
  • 9
  • 22
10
votes
3 answers

How to create database in database docker container?

I'm new in docker, so cant understand - if I want to build container of mysql/postgresql/clickhouse etc - how to create database and schema of database/table? Maybe in Dockerfile or i can do it from docker-compose.yml? I mean, that I dont know when…
Den Hm
  • 101
  • 1
  • 1
  • 3
10
votes
1 answer

Alert message not showing up in slack using prometheus and alertmanager

I am trying to get the alert found by Prometheus to be notified in slack using alertmanager. This is the alert.rules file and is working fine groups: - name: Instances rules: # Alert for any instance that is unreachable for >5 minutes. -…
Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76
10
votes
2 answers

How to configure prometheus with alertmanager?

docker-compose.yml: This is the docker-compose to run the prometheus, node-exporter and alert-manager service. All the services are running great. Even the health status in target menu of prometheus shows ok. version: '2' services: …
Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76
10
votes
1 answer

How to use an environment variable from a docker-compose.yml in a Dockerfile?

My docker-compose.yml looks something like this: version: '2' services: myapp: build: context: . environment: - GITLAB_USER=myusername I want to use that environment variable inside a Dockerfile but it does not work: FROM…
Hedge
  • 16,142
  • 42
  • 141
  • 246
10
votes
1 answer

how to specify commit in docker-compose remote github build

I want to build services using Dockerfiles in remote projects found on github. This is for an end-to-end testing framework, so I need to be able to specify specific commits I want it to build. I am having a lot of difficulty trying to figure out how…
melchoir55
  • 6,842
  • 7
  • 60
  • 106
10
votes
3 answers

Docker compose not updating images after change

I have a yml file for docker compose to create two containers and connect them. I made some changes to the code today(replaced a folder to be added in one of the docker files).Here's the yml file: version: '3' services: web: build: ./web …
davidb
  • 1,503
  • 4
  • 30
  • 49
10
votes
2 answers

default-address-pools is not recognized by docker

I am trying to configure docker-compose to use different network range by default, so I follow instructions from https://github.com/moby/moby/pull/29376 However, I get following error: unable to configure the Docker docker daemon with…
Moisei
  • 1,162
  • 13
  • 30
10
votes
1 answer

using MPI with docker containers

I have created a docker image based on Ubuntu 16.04 and with all the dependencies needed to run MPI. It is public on docker-hub at: https://hub.docker.com/r/orwel84/ubuntu-16-mpi/ I use this image to create an MPI container. I can also compile a…
revolutionary
  • 3,314
  • 4
  • 36
  • 53
10
votes
4 answers

django cannot connect mysql in docker-compose

I'm very new for docker, now I am trying to run django with mariadb in docker through docker-compose, but I always get this error: I use Docker version 17.09.1-ce, build 19e2cf6, docker-compose version 1.18.0, build…
Belter
  • 3,573
  • 5
  • 42
  • 58
10
votes
1 answer

Build a single image based on docker compose containers

My compose-yaml has 3 services I am able to run the containers sucessfully when i am using docker-compose up. Now i want to build these 3 containers into single image. Is it possible? here is my compose-yaml version: '2' services: tomcat: …
Sunil Sunny
  • 531
  • 7
  • 30