Skip to content

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

Open
KKonaOG wants to merge 2 commits intocontainers: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 intocontainers:mainfrom
KKonaOG:fix/remote_git_context_respect_dockerfile_attribute

Conversation

@KKonaOG
Copy link
Copy Markdown

@KKonaOG KKonaOG commented Apr 19, 2026

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.

Copy link
Copy Markdown
Collaborator

@p12tic p12tic left a comment

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 added 2 commits April 22, 2026 04:14
… 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>
@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
Copy link
Copy Markdown
Author

KKonaOG commented Apr 22, 2026

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

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