I think supporting the “build:” directive on docker-compose yaml since podman can do both build and run containers 

Very common use case for a large audience using docker-compose transitioning and migrating to podman to have the functionality of “docker-compose build” followed by the normal “docker-compose up”

Here is an example of using “build:” in one my labs for distributing tracing using nodejs and java  https://cloudnative101.dev/electives/dist-trace/activities/lab1

I think is ok if it’s not supported from kube yaml pod just from a compose, since a podspec should not have any build directives

- Carlos Santana

On Feb 5, 2021, at 3:57 AM, Rudolf Vesely via Podman <podman@lists.podman.io> wrote:

Hi Scott,

I'm looking for the same functionality. If that's OK I'd like to answer your question.

If we could see the source/origin docker-compose YAML,

The Yaml might get messed up so you can also get it from here: https://gist.github.com/rudolfvesely/4ad6f762eafbe5417f80ff469b690c38

I intentionally made it complicated to show various options from "docker-compose".

- "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/Containerfile
- "dockerfile: ./foo/bar/containerfile_for_db" is used when Dockerfile has different name. In other words this will run "docker build --file=foo/bar/containerfile_for_db"

$ cat ./something/api.env

$ cat .env

$ cat docker-compose.yml
version: "3.9"
   # "Dockerfile" is located in the working directory and will be used to build image
   build: .
   # build arguments (used in Dockerfile)
     APP_HOME: app
   # environment variables
     FLASK_ENV: development
   # "Dockerfile" has different name
   dockerfile: ./foo/bar/containerfile_for_db
   # environment variables in a file
    - ./something/api.env
   # variable defined in ".env"
   image: "webapp:${TAG}"
     - logvolume01:/var/log
     - "5000:5000"

Please let me know if you have other questions.

Kind regards,

Rudolf Vesely
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io