Skip to content

Conversation

@jedevc
Copy link
Collaborator

@jedevc jedevc commented Jun 14, 2023

🛠️ Fixes #1627

We need to resolve the strip the cwd:// prefix before attempting to resolve the dockerfile. Otherwise, we'll get the cwd:// prefix in the dockerfile name, which isn't stripped out later.

Also added this to the test case, where previously we would get a cwd:// in the dockerfile name, now we correctly resolve it.

We need to resolve the strip the cwd:// prefix before attempting to
resolve the dockerfile. Otherwise, we'll get the cwd:// prefix in the
dockerfile name, which isn't stripped out later.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested review from crazy-max and tonistiigi June 14, 2023 11:21
@jedevc jedevc added this to the v0.11.1 milestone Jun 14, 2023
@crazy-max crazy-max merged commit ee36e22 into docker:master Jun 15, 2023
@jedevc jedevc deleted the fix-dockerfile-cwd-join branch June 15, 2023 12:11
@tonistiigi
Copy link
Member

I think the old behavior is intentional. It is for the use case where you have docker build logic only in the remote repository and source files in local dir. In that case, the Dockerfile and Bake file are stored together (similar to using dockerfile_inline in bake). If a remote Bake file also wants to load Dockerfile from local cmd dir it should use cwd:// there as well.

If someone can prove this is a regression that would change things.

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

Successfully merging this pull request may close these issues.

[BUG] Bake build fails when using BAKE_CMD_CONTEXT locally

3 participants