28 votes
Accepted

Why is one not allowed to use a Boolean in a docker-compose.yml?

This come from a design choice of YAML language about booleans Every unquoted value matching this "regex": y|Y|yes|Yes|YES|n|N|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|...
user avatar
  • 11k
18 votes
Accepted

docker-compose healthcheck for rabbitMQ

You could use the command rabbitmq-diagnostics -q ping in case you just need a basic check. healthcheck: test: rabbitmq-diagnostics -q ping interval: 30s timeout: 30s retries: 3 More ...
user avatar
15 votes

docker-compose invalid type, it should be a string

The Docker Compose file reference states, that environment variables are defined as VARIABLE=value array elements. For your case, the docker-compose.yml file would need to be changed to this: version:...
user avatar
  • 481
14 votes

docker-compose invalid type, it should be a string

You need to remove dash in front of variable. Use syntax like that: environment: NODE_CONFIG: '{"DATABASE_URL":"http://db:5984"}'
user avatar
  • 241
14 votes
Accepted

How can I force Docker Compose to rebuild containers when dockerfile changes?

Why not docker-compose build ? https://docs.docker.com/compose/reference/build/ You can also do docker-compose up --build to force a rebuild.
user avatar
  • 256
11 votes
Accepted

Is running docker-compose not supported in BitBucket?

Here is my solution: (bitbucket-pipelines.yml) pipelines: default: - step: script: - export DOCKER_COMPOSE_VERSION=1.18.0 - export DOCKER_COMPOSE_URL=https://github....
user avatar
11 votes

Why is one not allowed to use a Boolean in a docker-compose.yml?

That's YAML. It interprets true as a boolean. Envars must be strings, hence the requirement to make the type explicit via quotes. Test this out with https://www.json2yaml.com/
user avatar
  • 1,231
10 votes
Accepted

Is it possible to build docker images using docker-compose concurrently?

Yes, it's possible. You can use --parallel option since docker-composer 1.23.2 version. Version 1.23.2 also correct 1.23.0 bug: Reverted a 1.23.0 change that appended random strings to container ...
user avatar
10 votes
Accepted

Why are unnamed volumes created when `docker-compose up` is run and do these double after issuing `docker-compose down && docker-compose up`?

Research indicated that the anonymous volumes were created by influxdb and grafana/grafana. Anonymous volumes are not given an explicit name when they are first mounted into a container, so ...
user avatar
  • 12.5k
10 votes
Accepted

How to deal with docker compose's naming convention of named volumes?

Docker Prepends the current folder name with all the components name created using docker compose file. Eg : If the current folder name containing the docker-compose.yml file is test, all the volumes,...
user avatar
10 votes

Healthcheck: CMD vs CMD-SHELL

Docker can either run the command using the equivalent of the OS exec syscall directly in the kernel, or it can run a shell (typically /bin/sh) to call your command. A shell provides functionality you ...
user avatar
  • 2,700
8 votes
Accepted

Why should you do port mapping for docker containers?

TL;DR There are a number of use cases for port mapping, but for DevOps at scale the primary reason is generally to enable mapping well-known service ports to available ports on the host. This matters ...
user avatar
  • 232
8 votes

How can I force Docker Compose to rebuild containers when dockerfile changes?

Use this command: docker-compose up --build
user avatar
8 votes
Accepted

Docker compose volume syntax valid for Windows and Linux

Yes. Just use ./ for you current directory that the Docker-compose file is in. Your "working directory" for the compose file is just "./". If you are trying to set a directory ...
user avatar
7 votes
Accepted

Error with docker-compose - image not supported?

“Image” needs to be at the same level as “build”.
user avatar
7 votes

Internal network between container Docker Compose with outgoing connection

Internal Docker networks mean there is no gateway configured to reach the outside internet, you can only reach other containers from that network. In your scenario, none of your networks should have ...
user avatar
  • 2,700
7 votes
Accepted

Stress testing for docker container

Just a quick follow-up on pumba. Installation (for Ubuntu): $ curl -SL https://github.com/alexei-led/pumba/releases/download/0.7.2/pumba_linux_amd64 -O $ sudo mv pumba_linux_amd64 /usr/bin/pumba $ ...
user avatar
7 votes
Accepted

What is the purpose of running PHP-FPM in its own container instead in the same container as apache2/nginx?

Im heavily investigating this, and like many people, im discovering that in 2020 there doesn't seem to be so much logic in separating tightly coupled webserver + PHP + app process/code from each other:...
user avatar
  • 186
7 votes
Accepted

Docker-compose containers can't connect to each other

The Dockerfile specifies how a container image is built. The Dockerfile’s RUN command is trying to ping the db container, which is not yet running during the build phase. Once the container images ...
user avatar
  • 708
6 votes
Accepted

Understanding how Docker volumes work with compose

db_data:/var/lib/mysql simply means that the db_data volume that was previously created will be made available in the container at /var/lib/mysql. In you example it's created at the very end of the ...
user avatar
6 votes

Is running docker-compose not supported in BitBucket?

We are less likely to see support of native docker-compose integration because pipelines API is a custom implementation of similar functionality, and also because possible security issues, but looks ...
user avatar
  • 657
6 votes

docker-compose invalid type, it should be a string

The args elements themselves need to be a string args: - 'MAVEN_USER=$MAVEN_USER' - 'MAVEN_PASSWORD=$MAVEN_PASSWORD'
user avatar
6 votes

How can I force Docker Compose to rebuild containers when dockerfile changes?

I've found sometimes I need docker-compose build --no-cache if I have a bad deploy.
user avatar
  • 161
6 votes

docker-compose.yml - make network name configurable via environment variable

It is possible via network name: networks: mynetwork: name: ${STAGE_NAME} where mynetwork - name "inside" stack ${STAGE_NAME} -name for other stacks/services/containers See comment from ...
user avatar
  • 161
6 votes

Why does chown not work in RUN command in Docker?

Your mkdir and chown commands are RUN when building the image, whereas you then mount /var/www/app from a VOLUME, so you are replacing the created and chowned folder with the contents of ./app on the ...
user avatar
  • 161
6 votes
Accepted

Is there one website that contains all relevant DevOps news and gets updated on a daily basis?

There is a protocol for this: RSS, Rich Site Summary. Technically, there are 3 protocols RSS, RSS2 and Atom, but most readers support all of them, and many servers mix RSS and RSS2 features. First, ...
user avatar
5 votes
Accepted

Docker swarm stop spin up containers at 250

I just figure it out. The problem is not with the service or the swarm, it's with the network. When I use driver: overlay the default subnet is 10.0.0.0/24 which result in 254 address. So I change ...
user avatar
  • 201
5 votes
Accepted

How to "docker-compose build" a service from code located in local git repository?

What you are specifically after (building from a bare repository on a local filesystem) isn't functionality offered by Docker, and by extension, docker-compose. Docker supports building from a few ...
user avatar
  • 1,345
5 votes

Unable to mount docker folder into host using docker-compose

If you use CentOS 7 (as I have ). You may have SELinux turned on by default.check https://www.rootusers.com/how-to-enable-or-disable-selinux-in-centos-rhel-7/ or mount like this: volumes: - ./...
user avatar
5 votes
Accepted

How to populate docker volumes in a build step to be used by a different container

docker-compose is just a glorified wrapper around docker which gives you a nice textual representation of all the options you would regularly give to docker build or docker run. Plus, of course, it ...
user avatar
  • 4,696

Only top scored, non community-wiki answers of a minimum length are eligible