Questions tagged [docker-compose]

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

Filter by
Sorted by
Tagged with
46
votes
4answers
86k views

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 ...
35
votes
5answers
45k views

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 ...
34
votes
8answers
37k views

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 ...
32
votes
1answer
60k views

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" ...
13
votes
4answers
4k views

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 ...
10
votes
3answers
40k views

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: ...
10
votes
2answers
9k views

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 ...
9
votes
1answer
11k views

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] ...
8
votes
1answer
8k views

How to forward Docker container logs to ELK?

I would like to know what is the easiest way to forward my docker container logs to an ELK server, so far the solutions I have tried after having searched the internet didn't work at all. Basically ...
7
votes
4answers
8k views

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 ...
7
votes
1answer
4k views

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 ...
7
votes
1answer
8k views

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 ...
7
votes
2answers
10k views

Where is docker volume stored in the host computer for docker-compose?

Consider the following docker-compose file version: "2" services: postgres: image: postgres:9.6 volumes: - ./vol_folder:/var/lib/postgresql ports: - "5432:5432" Here is my ...
7
votes
1answer
2k views

WEBRTC MCU/SFU inside kubernetes - Port Ranges?

I am using janus-gateway as a webrtc media server for group videocalling. Previously I had deployed it in a single node using docker-compose but now I want to be able to scale it horizontally. For ...
6
votes
3answers
12k views

CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team

I'm trying to run docker-compose (which was installed via pip), yet running into following error: # pip install --quiet docker-compose # docker-compose ps /usr/local/lib/python2.7/dist-packages/...
6
votes
2answers
4k views

How to prevent docker-compose appending hashes to created container names?

I have a server with several lxc containers. In some of the containers there is a docker installed. Usually a docker compose action in these LXC containers results in container names with the format ...
6
votes
1answer
2k views

How to secure a docker host to not allow rooting

I am trying to make docker on a server more secure. The main problem is that most people say "if a person has access to docker, they can be root too" for an administrator point of few this is not ...
6
votes
1answer
6k views

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

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 ...
5
votes
2answers
6k views

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 ...
5
votes
2answers
16k views

Why is there no php.ini file when I install PHP in a docker container?

I'm using docker-compose to setup a minimal nginx + php-fpm application but for some reason there is no php.ini file on the docker container (I know because phpinfo() says Loaded Configuration File: (...
5
votes
1answer
7k views

docker-compose exec composer as user

I have a docker-compose setup working perfect on my local machine for my symfony projects with nginx, php7-fpm and mysql. I often need to install new packages via composer, so I just deliver the ...
5
votes
1answer
3k views

nginx won't serve json file unless specifying .json in url

I have the following nginx.conf file: server { listen 8080; server_name dummy_server; root /usr/share/nginx/html; location / { if ($request_method = 'OPTIONS') { ...
5
votes
2answers
16k views

Docker + Nginx + PHP-FPM error: [emerg] 1#1: host not found in upstream [closed]

I have a docker setup for LEMP stack that I cloned from this repo. Everything works nicely on my development machine running window 10, but when I push the image to docker hub and pull it on my VPS ...
5
votes
2answers
9k views

Configure php-fpm to access environment variables in docker

I'm running php7-fpm in a docker container. However my php scripts aren't able to access environments variables set in my docker-compose file. getenv('MY_ENV_VAR') returns FALSE. I've changed /etc/...
5
votes
2answers
7k views

“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 ...
5
votes
2answers
3k views

How to forward application logs from Docker containers to ELK

I'm trying to centralise logging in an environment that using multiple application technologies (Java, Rails and various DBs). We want to developers to bring up stacks with Docker Compose, but we ...
4
votes
1answer
563 views

Why isn't firewalld filtering the services running in my Docker containers?

My services were filtered correctly after migrating from iptables to firewalld and updating the rules with firewall-cmd. Then I moved all services to containers using Docker, and ran everything with ...
4
votes
2answers
10k views

Using iptables rules aren't working with Docker container

Just set up an ElasticSearch container to use with company's Laravel app. Creating docker-compose.yml and running it is flawless and straight-forward but the issue occurs when I want to firewall this ...
4
votes
1answer
4k views

Can't curl a linked container in Docker

I don't have a complex setup. 2 containers, one for my application and one for my API. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS ...
4
votes
0answers
885 views

Podman: Method to convert docker-compose files to systemd unit files

I'm migrating away from docker towards podman (not going straight for kubernetes, as that would definitely be overkill at this point). Now, many an elegant configuration can be had as docker-compose ...
4
votes
2answers
662 views

Docker-Compose in Development - Managing Subnets

I'm currently using Docker-Compose for development with a small team of people. I'll describe the setup and scenario we currently are facing. We have a single project checked into our VCS. ...
3
votes
2answers
11k views

Docker Compose returns error “networks have overlapping IPv4”

starting by saying I am totally new to Docker and I am not yet familiarized with the Docker ecosystem. What I try to perform is to create a docker-composer.yml to be used in my local dev environment ...
3
votes
2answers
37 views

Which tools simplify administration tasks with Docker containers? [closed]

Context: My task is to administer a virtual machine with about 5 web services for a small workgroup. I plan to run all services in Docker containers. An additional nginx Docker container should ...
3
votes
1answer
3k views

connection between two docker containers of two stacks

I am building on two projects which share some common data. The services of the two projects are built from two docker-compose YML files. I want to access the MySQL server specified in one stack from ...
3
votes
1answer
1k views

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 ...
3
votes
3answers
6k views

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-...
3
votes
1answer
3k views

Setup wordpress container in subdirectory with nginx and mariadb

Ok guys here is the problem: i have my webserver serving a website, a cms and mobile app api using a subdirectory approach like this localhost -> site localhost/cms localhost/api everything is ...
3
votes
1answer
535 views

MariaDB on docker keeps corrupting data

I'm using the official MariaDB mariadb:10.4.6-bionic image and I have a problem: my tables corrupt themselves. This had happened at least four times this month: on two different dev machines using ...
3
votes
1answer
1k views

How to specify the log tag from docker compose on google logging?

In my docker compose file, I can specify the logging driver as a "fluentd" and by default, it pushes the log to the listener of google-fluentd on port 24224 I can see the log appear on the logging ...
3
votes
1answer
3k views

docker & portainer - use it to create container

I still try to understand some things with docker helped with portainer but i can't find tuto for: 1 - Persistent data: I would like to run Mariadb container with persistent database. So i would like ...
3
votes
0answers
382 views

Should I use systemd or docker-compose to keep Docker containers running on my systems?

We are talking about Docker containers as sysdig, consul, fluentd, mesos-slave, etc. that we are running on almost all machines. Currently we are using Ubuntu's Upstart and CoreOS's Fleetctl. We're ...
3
votes
0answers
476 views

Connecting a local Elixir/Erlang to a running application inside a Docker container [closed]

I've got an Elixir application running inside a Docker container (in my laptop). The Elixir application was executed with the following command: iex \ --name test@1.2.3.4 \ --cookie secret \ --...
3
votes
0answers
1k views

Relative path of build context in docker-compose configuration is not resolved relative to the compose yml file location

I have a docker-compose project with container configurations in subdirectories like . ├── a.yml └── b └── b.yml a.yml is version: "2.2" services: a: build: context: ./ b.yml is ...
3
votes
0answers
226 views

The strangest docker fault I've ever seen

I am using Docker with docker-mailserver on one of my servers. Very strange trouble appeared after migrating some services from legacy Debian Jessie server to Ubuntu 16.04 LTS server. Parameters of ...
3
votes
1answer
2k views

Using Ansible docker_service module to deploy service to swarm

I'm trying to deploy a Docker service into swarm but always ending up with running container on my localhost (the one I use as a docker swarm manager) and no service Here's my setup: I have 3 node ...
2
votes
1answer
4k views

Docker - PHP 7.2 FPM Alpine - Imagick

I'm using Docker image php:7.2-fpm-alpine as base image with following command to install Imagick: RUN apk add --update --no-cache autoconf g++ imagemagick-dev libtool make pcre-dev \ && ...
2
votes
1answer
4k views

TCP connections between docker containers timeout after ~10000 connections

I have 2 containers defined in a docker-compose.yml file, and am using them to run some rspec tests in a CI pipeline - the first container executes the tests, the second is an nginx container that is ...
2
votes
2answers
4k views

EC2 Instance Freezes

I am experiencing sudden freezes in one particular instance. Here some details of the instance: Type: t2.micro Region/av. zone: us-west-2b OS: amzn-ami-hvm-2018.03.0.20180811-x86_64-gp2 (ami-a0cfeed8) ...
2
votes
1answer
14k views

502 Bad Gateway/ failed (111: Connection refused) while connecting to upstream [duplicate]

I have the following docker-compose xml web: build: nginx/. container_name: nginx ports: - "80:80" links: - "openchain" restart: always wallet: build: wallet/. container_name: ...
2
votes
1answer
622 views

Php+Nginx+Varnish on docker-compose, ubuntu18

!Important. SOLUTION FOUND. Everything below is working fine for me. And this is almost the only case when you may copy solution from the question. For it read "My Configuration" section Main ...

1
2 3 4 5
9