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.

657 questions
108
votes
6 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,416
  • 2
  • 12
  • 15
93
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 restart: always volumes: -…
48
votes
12 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…
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…
kaiser
  • 1,251
33
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…
29
votes
3 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
  • 393
21
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: - "3306:3306" volumes: -…
Quoc Dat
  • 313
17
votes
6 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,905
16
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: -…
15
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
  • 290
14
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
  • 311
14
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,397
13
votes
3 answers

How to do docker-compose down without the config file that made the up?

When you do docker-compose up , it's based on a docker-compose.yml file. This usually brings up a network, builds and runs multiple services. If you do the up with the -d flag, the docker-compose client detaches and let the servers alone. If you do…
13
votes
4 answers

How-to install docker-compose on al2023

The docker documentation states the compose plugin is installed automatically with the latest docker version. I built a new EC2 instance running al2023 and installed docker. But received this error: $ docker compose --help docker: 'compose' is not a…
D.Fitz
  • 390
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
  • 2
  • 4
  • 13
1
2 3
…
43 44