Skip to content

Adds the correct behavior for the dockerfile attribute when using git context.#1441

Open
KKonaOG wants to merge 2 commits into
containers:mainfrom
KKonaOG:fix/remote_git_context_respect_dockerfile_attribute
Open

Adds the correct behavior for the dockerfile attribute when using git context.#1441
KKonaOG wants to merge 2 commits into
containers:mainfrom
KKonaOG:fix/remote_git_context_respect_dockerfile_attribute

Conversation

@KKonaOG

@KKonaOG KKonaOG commented Apr 19, 2026

Copy link
Copy Markdown

The current implementation of Git remote contexts fails to respect/honor the Dockerfile attribute in the compose file. This fix results in "Dockerfile" being used if the attribute is unset and the value of the dockerfile attribute otherwise. This brings it in-line with docker compose and the intended compose-spec behavior.

@KKonaOG KKonaOG force-pushed the fix/remote_git_context_respect_dockerfile_attribute branch from a91341b to 42e9e34 Compare April 19, 2026 15:47
Comment thread podman_compose.py Outdated
raise OSError(f"Dockerfile not found in {dockerfile}")
raise OSError(f"Dockerfile not found in {ctx}")

if is_context_git_url(ctx) and dockerfile:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to reuse if not is_context_git_url(ctx): check above. Remove not to simplify the conditional.

@p12tic p12tic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just a small nit and it's ready to merge.

@KKonaOG KKonaOG force-pushed the fix/remote_git_context_respect_dockerfile_attribute branch from f012e7a to 678f6f1 Compare April 22, 2026 09:15
@KKonaOG KKonaOG requested a review from p12tic April 22, 2026 09:15
@KKonaOG

KKonaOG commented Apr 22, 2026

Copy link
Copy Markdown
Author

I believe that is what you were suggesting! I'll remember to do a sign-off commit eventually haha!

@p12tic p12tic force-pushed the fix/remote_git_context_respect_dockerfile_attribute branch from 678f6f1 to 536c10d Compare June 13, 2026 13:24
KKonaOG added 2 commits June 22, 2026 23:51
… context.

Signed-off-by: KKonaOG <kkonaog@weavrstudios.dev>

Verify we are using a git context and a dockerfile has been specified. This better targets the new behavior

Signed-off-by: KKonaOG <kkonaog@weavrstudios.dev>

Add newsfragment

Signed-off-by: KKonaOG <kkonaog@weavrstudios.dev>

Add unit test

Signed-off-by: KKonaOG <kkonaog@weavrstudios.dev>
…ing two is_context_git_url calls

Signed-off-by: KKonaOG <kkonaog@weavrstudios.dev>
@p12tic p12tic force-pushed the fix/remote_git_context_respect_dockerfile_attribute branch from 536c10d to ca68cc5 Compare June 22, 2026 20:51
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.

2 participants