Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bake v0.9.0 targets Dockerfile for external images in compose.yml #1292

Closed
rdmolony opened this issue Aug 23, 2022 · 2 comments
Closed

Bake v0.9.0 targets Dockerfile for external images in compose.yml #1292

rdmolony opened this issue Aug 23, 2022 · 2 comments

Comments

@rdmolony
Copy link

rdmolony commented Aug 23, 2022

Hi there,

I noticed that the buildx bake definition has changed from v0.8.2 to v0.9.0

Specifically, this compose definition ...

version: "3.7"

services:
  external:
    image: hello-world
  internal:
    build:
      context: .
      target: valid
    depends_on:
      - external

... & this Dockerfile ...

FROM hello-world as base

FROM base as valid

RUN echo "I should be run"

FROM base as invalid

RUN echo "I should not be run"

... produce different bake definitions across versions ...

v0.8.2 is ...

  /usr/bin/docker buildx bake --metadata-file /tmp/docker-build-push-EkDBPt/metadata-file --print
  {
    "group": {
      "default": {
        "targets": [
          "internal"
        ]
      }
    },
    "target": {
      "internal": {
        "context": ".",
        "dockerfile": "Dockerfile",
        "target": "valid"
      }
    }
  }

v0.9.0 is ...

  /usr/bin/docker buildx bake --metadata-file /tmp/docker-build-push-lqeH1b/metadata-file --print
  {
    "group": {
      "default": {
        "targets": [
          "external",
          "internal"
        ]
      }
    },
    "target": {
      "external": {
        "context": ".",
        "dockerfile": "Dockerfile",
        "tags": [
          "hello-world"
        ]
      },
      "internal": {
        "context": ".",
        "dockerfile": "Dockerfile",
        "target": "valid"
      }
    }
  }

I created a min reprod examples as PRs in https://github.com/rdmolony/buildx-bake-targets-are-incorrect/pulls

This resulted in my builds failing as since the update all build steps run in GitHub Actions

After a downgrade to v0.8.2 this isn't an issue for me

@crazy-max
Copy link
Member

Already fixed in 0.9.1, see #1277

@cpuguy83 Looks like GitHub Runners are updated to Buildx 0.9.0 but not 0.9.1, am I right?

@cpuguy83
Copy link
Contributor

0.9.1 is going out to our repos now.
It'll take some time for Github to release new images with the updated package but you should be able to update via apt inside your runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants