Skip to content

Using target platform as a variable in compose file. #792

Open
@wasabii

Description

@wasabii

I have an existing compose file which is somewhat like this:

services:
  asd-scheduler:
    image: asd/scheduler:${VERSION}
    build:
      context: ${BUILDDIR}/docker/${TARGETPLATFORM}/tmp/asdasd
      dockerfile: ${ROOTDIR}/src/asdasd/Dockerfile

The point here is that when building for a certain platform, I need to obtain completely different application files. So I change the context based on what platform I'm building for. Prevents copying a massive amount of useless stuff in.

Since buildx bake can now do this all on it's own, building for mulitple platforms, how can I have a variable available in this way? Is there any variable that can be used inside the compose file syntax that obtains the current target platform as known to bake?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions