Docker-compose.yml file that builds a base image, then children based on it?

Yes, kind of. Use it like this: version: ‘2’ services: wls-admin: container_name: wls-admin image: weblogic-domain build: context: wls-admin args: – ADMIN_PORT=${WLS_ADMIN_PORT} – CLUSTER_NAME=${WLS_CLUSTER_NAME} – PRODUCTION_MODE=dev networks: – wls-network image clause here makes docker-compose build generate docker image named weblogic-domain for this service. This image can be re-used by other services’ Dockerfiles, even in the same … Read more

Docker multiple environments

You could take some clues from “Using Compose in production” You’ll almost certainly want to make changes to your app configuration that are more appropriate to a live environment. These changes may include: Removing any volume bindings for application code, so that code stays inside the container and can’t be changed from outside Binding to … Read more

Docker-Compose postgres upgrade initdb: error: directory “/var/lib/postgresql/data” exists but is not empty

Quoting @yosifkit from this issue The volume needs to be empty or a valid already initialized postgres database with the file PG_VERSION in there so the init can be skipped. … If there are any files or folders in there like lost+found it will probably fail to initialize. If there are files that you want … Read more

How to disable output on one of containers?

Use –log-driver=none in docker run: docker run -d –log-driver=none selenium/standalone-firefox Or docker-compose.yml version: ‘2’ services: selenium: ports: – “4444:4444” logging: driver: “none” image: selenium/standalone-firefox You can also send the log to a file using: docker run -d –log-driver=none -e SE_OPTS=”log log.txt” selenium/standalone-firefox Or docker-compose.yml version: ‘2’ services: selenium: ports: – “4444:4444” logging: driver: “none” environment: … Read more

Docker-Compose: how to wait for other service to be ready?

Best Approach – Resilient App Starts While docker does support startup dependencies, they officially recommend updating your app start logic to test for the availability of external dependencies and retry. This has lots of benefits for robust applications that may restart in the wild on the fly in addition to circumventing the race condition in … Read more

Using Vault with docker-compose file

This is my current docker-compose config for using Vault in dev, but I use dedicated servers (not Docker) in production. # docker_compose.yml version: ‘2’ services: myvault: image: vault container_name: myvault ports: – “127.0.0.1:8200:8200” volumes: – ./file:/vault/file:rw – ./config:/vault/config:rw cap_add: – IPC_LOCK entrypoint: vault server -config=/vault/config/vault.json The volume mounts ensure the vault config is saved if … Read more

docker-compose tmpfs not working

I have been doing some testing in this regards, it looks like the /var/run directory is special in docker. Here is some sample config and output: ubuntu: image: ubuntu command: “bash -c ‘mount'” tmpfs: – /var/run – /var/cache Running docker-compose up ubuntu shows what is mounted. Can see /var/cache is mounted but /var/run isn’t. … … Read more

How to run wp cli in docker-compose.yml

Well there are a couple of problems. The first one is that those two containers (wordpress and wordpress-cli) don’t share a volume. So while wordpress has a wordpress installation ready, the wordpress-cli doesn’t. So you can add volumes to both containers, and then wordpress-cli will find the wordpress installation. Then there’s a second problem: the … Read more