Questions tagged [docker-compose]

Compose is a tool for defining and running multi-container Docker applications.

Docker Compose is a tool for defining and running multi-container Docker applications.

581 questions
84
votes
5 answers

Configuring Docker to not use the 172.17.0.0 range

Due to problems with captive portals and the default Docker IP range I am trying to make Docker use the 198.18.0.0 range, instead of 172.17.0.0, which clashes with the captive portals used on the trains where I live. Following the docs, I created…
jrtapsell
  • 1,176
  • 1
  • 10
  • 15
77
votes
1 answer

How does "restart: always" policy work in docker-compose?

I have docker compose file with PostgreSQL and my application, like this: version: '3' services: postgresql: image: postgres:9.6.6 ports: - 9932:5432 expose: - "5432" environment: - POSTGRES_PASSWORD=pass …
Marcin Zablocki
  • 873
  • 1
  • 6
  • 6
46
votes
4 answers

How is Docker Compose version 2 "volumes" syntax supposed to look?

With Docker Compose v1.6.0+, there now is a new/version 2 file syntax for the docker-compose.yml file. The changes include a separate top level key named volumes. This allows to "centralize" volume definitions in one place. What I am trying to do is…
kaiser
  • 1,251
  • 1
  • 16
  • 24
45
votes
11 answers

Check is container/service running with docker-compose

I am using the docker-compose. Some commands like up -d service_name or start service_name are returning right away and this is pretty useful if you don't want the containers running to depend on the state of the shell, like they do with regular up…
Ivan Kolmychek
  • 1,244
  • 2
  • 10
  • 13
28
votes
5 answers

Docker turn anonymous volume into named volume

I have tried out a docker image using the docker command line without specifying names for volumes. Now I found that I want to continue using this container/image but by defining the container in docker compose. What is best practice for keeping the…
freiheitsnetz
  • 393
  • 1
  • 3
  • 7
21
votes
2 answers

How and where to configure pm.max_children for php-fpm with Docker?

In a Web application with Nginx and PHP-FPM, I've noticed moments of slowness and analyzing the logs, I found this message, which appears from time to time: [19-Nov-2017 19:24:09] WARNING: [pool www] server reached pm.max_children setting (5),…
lfalmeida
  • 313
  • 1
  • 2
  • 4
18
votes
6 answers

Can not access mysql docker

I am using docker-compose to create mysql container. I get host IP 172.21.0.2. But when I connect mysql. I get error: My docker-compose.yml: version: '2' services: ### Mysql container mysql: image: mysql:latest ports: -…
Quoc Dat
  • 183
  • 1
  • 1
  • 6
14
votes
2 answers

Force Ansible to log off to refresh user groups

I'm setting up a server with Ansible and Docker. I'm currently learning both technologies, so please bear with me if I'm being overly stupid here. In order to run run Docker commands, the user has to be in the docker user group. So I'm doing this: -…
14
votes
4 answers

Why does docker-compose issue a "No such file or directory" when the file is there?

I am testing a bare metal recovery of my server which basically starts a set of docker container with my services. I recovered from a backup /etc/docker, where I keep all the configuration and persistent volumes. I then tried to start one of the…
WoJ
  • 3,607
  • 9
  • 49
  • 79
13
votes
2 answers

Can not stop tzdata asking for user input during docker-compose build

I've tried several things including ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Lnndon RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone But whatever I do I get Configuring tzdata ------------------ Please select…
Ben Edwards
  • 341
  • 4
  • 13
12
votes
3 answers

"docker-compose up" as root user or non-root user?

After reading some articles I'm still not sure about what user I should use to run a docker container. Are there any security concerns when running a docker container as root user? Is it ok to run docker containers as root user OR should I use my…
r00tusr
  • 191
  • 1
  • 1
  • 6
12
votes
1 answer

Expose a Unix socket to the host system from inside from a Docker container

I would like to run aweb server inside a Docker container that listens to a Unix socket, instead of to a port. I'm finding a lot of results on sharing the Docker socket, but I don't think that's what I want. I want the host system to be able to…
Drazisil
  • 260
  • 1
  • 2
  • 8
11
votes
3 answers

How do I give a docker container its own routable IP on the original network?

Main question Imagine this scenario. A network of 192.168.0.0/24. A computer with hostname 'Docker-Host' is running a docker engine at 192.168.0.2 'Docker-Host' has sshd server running On 'Docker-Host' , I'm running a application in a container…
TrevorKS
  • 263
  • 1
  • 2
  • 7
11
votes
2 answers

docker-compose for nginx and nodejs server

I have the following docker-compose.yml file: version: '3' services: server: build: context: ../../ dockerfile: ./packages/website/Dockerfile command: node /cutting/index.js environment: …
dagda1
  • 247
  • 3
  • 7
  • 19
11
votes
5 answers

Is there any way to run Postfix in foreground?

Is there any way to run Postfix in foreground? I want to run Postfix as PID 1 in docker. I don't want to use any bash shell, supervisorD, or any wrapper to start it. I just want to know if there is any way to start it in foreground so I can check…
Farhan
  • 4,269
  • 11
  • 49
  • 80
1
2 3
38 39