You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "lihaosky (via GitHub)" <gi...@apache.org> on 2026/05/29 18:19:11 UTC
[PR] [FLINK-39796] Fix snapshot bake by pinning bake-action to local source [flink-docker]
lihaosky opened a new pull request, #261:
URL: https://github.com/apache/flink-docker/pull/261
## Problem
The `Publish SNAPSHOTs` workflow has been failing on every run. Each matrix job dies at the *Build and push Docker images* step with:
```
ERROR: failed to find target docker-metadata-action
##[error]cannot parse bake definitions: ERROR: failed to find target docker-metadata-action
```
## Root cause
`docker-bake.hcl`'s `bake-platform` target does `inherits = ["docker-metadata-action"]`. That target is defined as an empty stub (`target "docker-metadata-action" {}`) on every `dev-*` branch, but **not on `master`**.
The regression was triggered by [FLINK-39796] bumping `docker/bake-action` from v4 to v7. v7 changed the default of an unset `source` input: instead of baking the **local working tree**, it now falls back to the workflow's own git context and bakes it as a **remote ref**, so buildx fetches `docker-bake.hcl` (and the build context) from the triggering commit on `master`:
```
docker buildx bake https://github.com/apache/flink-docker.git#<sha> --file .github/workflows/docker-bake.hcl ... bake-platform
```
Since the job checks out a `dev-*` branch but v7 reads `master`, two things break:
1. `master`'s `docker-bake.hcl` lacks the `docker-metadata-action` stub → `inherits` fails.
2. The snapshot Dockerfile is generated at runtime by `add-custom.sh` into the local working tree and is never committed, so a remote bake context could not find `$DOCKER_FILE` anyway.
This is why the workflow was green on v4 (which baked the local `dev-*` checkout that has both the stub and the generated Dockerfile) and red on v7.
## Fix
Set `source: .` on the bake step to restore the pre-v7 behavior of baking the local working tree. This resolves both issues at once: the checked-out `dev-*` tree contains both the generated Dockerfile and the `docker-metadata-action` stub.
## Notes
- An alternative/complementary change would be to add `target "docker-metadata-action" {}` to `master`'s `docker-bake.hcl` to match the `dev-*` branches. That alone is **not** sufficient under v7's remote bake, because the runtime-generated Dockerfile still wouldn't exist in the remote context — hence pinning `source: .` is the actual fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39796] Fix snapshot bake by pinning bake-action to local source [flink-docker]
Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal merged PR #261:
URL: https://github.com/apache/flink-docker/pull/261
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org