Pass argument to docker compose

In docker-compose, arguments are available and usefull only in dockerfile. You can specify what you are doing in the level ahead like following: #dockerfile ARG PORT ENV SERVER_URL “https://0.0.0.0:$PORT” Your port can be set in your docker-compose.yml: build: context: . args: – PORT=443 It is actually an environment variable in any case. You can pass … Read more

how do you manage secret values with docker-compose v3.1?

You can read the corresponding section from the official documentation. To use secrets you need to add two things into your docker-compose.yml file. First, a top-level secrets: block that defines all of the secrets. Then, another secrets: block under each service that specifies which secrets the service should receive. As an example, create the two … Read more

How to tag docker image with docker-compose

It seems the docs/tool have been updated and you can now add the image tag to your script. This was successful for me. Example: version: ‘2’ services: baggins.api.rest: image: my.image.name:rc2 build: context: ../.. dockerfile: app/Docker/Dockerfile.release ports: … https://docs.docker.com/compose/compose-file/#build

docker-compose build environment variable

There’s a note in the docs: Note: If your service specifies a build option, variables defined in environment are not automatically visible during the build. Use the args sub-option of build to define build-time environment variables. It’s also described in here. First (as mentioned above), you need to specify ARG in Dockerfile: FROM mhart/alpine-node:10 ARG … Read more