I'm looking for the same functionality. If that's OK I'd like to answer your
If we could see the source/origin docker-compose YAML,
The Yaml might get messed up so you can also get it from here:
I intentionally made it complicated to show various options from
- "build: ." will use Dockerfile (in case of Podman this should be
Containerfile) to build image. In other words this will run "docker build ."
- "args" will define / overwrite values in "ARG" in
- "dockerfile: ./foo/bar/containerfile_for_db" is used when Dockerfile has
different name. In other words this will run "docker build
$ cat ./something/api.env
$ cat .env
$ cat docker-compose.yml
# "Dockerfile" is located in the working directory and will be used to
# build arguments (used in Dockerfile)
# environment variables
# "Dockerfile" has different name
# environment variables in a file
# variable defined in ".env"
Please let me know if you have other questions.