25

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|OFF Will be converted to True or False. This start causing a problem when your code will test an environment value to be yes or no for example taking this script (...


13

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: '3' services: server: ports: - 13045:3000 environment: - NODE_CONFIG='{"DATABASE_URL":"http://db:5984"}'


11

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/


10

Here is my solution: (bitbucket-pipelines.yml) pipelines: default: - step: script: - export DOCKER_COMPOSE_VERSION=1.18.0 - export DOCKER_COMPOSE_URL=https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) - curl -L $DOCKER_COMPOSE_URL > docker-...


10

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 names created by docker-compose up, causing addressability issues. Note: Containers created by docker-compose run will continue to use randomly generated ...


10

You need to remove dash in front of variable. Use syntax like that: environment: NODE_CONFIG: '{"DATABASE_URL":"http://db:5984"}'


10

Why not docker-compose build ? https://docs.docker.com/compose/reference/build/ You can also do docker-compose up --build to force a rebuild.


8

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 Docker gives them a random name that is guaranteed to be unique within a given Docker host. Besides the name, named and anonymous volumes behave in the same ...


8

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 when you're running large numbers of containers that use the same port by default, and you don't want to manually assign or track alternative port numbers. A ...


7

“Image” needs to be at the same level as “build”.


7

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,network and container names will get test appended to it. In order to solve the problem people earlier proposed the idea of using -p flag with docker-compose ...


7

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 have been created, compose will start the containers and they will be able to address each other via their service names (db and web). To accomplish what you want,...


6

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 compose file. From the Docker documentation: "The docker volume db_data persists any updates made by Wordpress to the database." Compose volumes works the same ...


6

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 like more features are currently in development to implement more docker-compose-like features in this open issue. UPDATE: added support for multi-container ...


6

Use this command: docker-compose up --build


6

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, choose your RSS reader, from: browser add-ons like Feedbro, centralized aggregators like Feedly and FeedReader, stand-alone applications like RSSOwl mail ...


6

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 $ sudo chmod +x /usr/bin/pumba $ pumba --version It uses stress-ng under the hood, so same commands apply. Examples: $ pumba stress -d 1m container_name -d 1m - ...


6

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: Two main arguments for separation are scalability and separation of concerns (one process per container). Logically the webserver should only act as webserver ...


5

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 different URLs, but not bare repositories on local filesystems. You can try a few workarounds: Build straight from Github: docker build https://github.com/docker/...


5

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: - ./database:/var/lib/mysql:Z - ./_conf/mariadb.cnf:/etc/mysql/my.cnf:Z - ./logs:/var/log/mysql:Z


5

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 the mask in the subnet, to 22, which result in 1022 address, I added: ipam: config: -subnet: 10.0.0.0/22 And now the network section in the docker-compose ...


5

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 bundles several docker images/containers together. That said, it has no provisions to run anything else than you would get by calling docker. I don't see how you ...


5

First, use alpine images if possible. Second, use ENV variables for prepare database configuration. More info. Third, use /docker-entrypoint-initdb.d directory for extend image. More info. Example stack with devlopment environment. version: '3.2' services: example: image: "${EXAMPLE_SERVICE}:${EXAMPLE_SERVICE__VERSION}-development" build: ...


5

There are a few features of docker-compose that are not implemented in docker stack deploy and vice versa. With docker-compose, you can run privileged containers and change capabilities which is not supported with swarm services yet. You can also run a container that is designed to exit, e.g. a batch job, more intuitively in docker-compose than in swarm ...


5

I found the reason of the problem. In Docker "anything after the VOLUME instruction in a Dockerfile will not be able to make changes to that volume". I define volume "./app:/var/www/app", and after that manipulate with it, so it's not work.


5

Yes. Just use ./ for you current directory that the Docker-compose file is in. Docker-Compose does not allow you to use a context that is located above the compose file, so everything the compose file will use is below the folder with the .yml. Your "working directory" for the compose file is just "./". If you are trying to set a directory below that it ...


4

According to this reply it should run by issuing: docker run -ti --rm -v `pwd`/docker-compose.yaml:/docker-compose.yml -v /var/run/docker.sock:/var/run/docker.sock docker/compose:1.16.1 up


4

I've tried your case, and it works fine on my side: version: '2' services: test: image: ubuntu:16.04 command: sleep 9999 extra_hosts: - "${HOSTNAME}:1.1.1.1" - "test.com:1.1.1.1" and here is what I get in the container cat /etc/hosts ... 1.1.1.1 a1.test.com 1.1.1.1 test.com


4

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


4

Docker does not allow to connect a container to the host network and any other Docker bridge network at the same time. I will try to illustrate the reason with an example: Let us think of a container C1. Hypothetically, C1 would be connected to the host network (--net=host) and a Docker bridge network Br1 (--net=Br1). A second container, let us say C2, is ...


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