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.

529 questions
66
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
  • 986
  • 1
  • 9
  • 15
61
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
  • 713
  • 1
  • 5
  • 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
43
votes
10 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,154
  • 2
  • 9
  • 13
25
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
  • 363
  • 1
  • 3
  • 7
18
votes
5 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
16
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
  • 163
  • 1
  • 1
  • 4
12
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: -…
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
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
  • 237
  • 3
  • 6
  • 19
11
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
  • 301
  • 3
  • 12
9
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
  • 161
  • 1
  • 1
  • 5
9
votes
2 answers

What are proper iptables Rules for Docker Host?

I have Ubuntu server with Docker to serve MySQL and SSH/SFTP and I need all ports except 3306 and 22 to be firewalled, pretty standard and trivial requirement, right? Now, I managed to find a sort of solution but it doesn't work fully for me as…
dzhi
  • 770
  • 3
  • 10
  • 23
9
votes
1 answer

How to prevent docker containers auto-start at daemon start in Windows?

I am using Docker and its docker-compose functionalities on Windows 10. Right now when I run the command docker-compose up -d to start some containers in the background, the containers started will be running even after rebooting my Docker-Host.…
Octavian
  • 211
  • 2
  • 5
9
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,365
  • 8
  • 46
  • 75
1
2 3
35 36