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

Add workdir #1881

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add workdir #1881

wants to merge 2 commits into from

Conversation

cwh42
Copy link

@cwh42 cwh42 commented Oct 23, 2024

Both, Dockerfile and KIWI support the WORK(ING)DIR directive.
Adding that to BaseContainerImage

@@ -100,6 +100,7 @@
{%- if image.expose_dockerfile %}{{ image.expose_dockerfile }}{% endif %}
{% if image.dockerfile_custom_end %}{{ image.dockerfile_custom_end }}{% endif %}
{%- if image.entrypoint_user %}USER {{ image.entrypoint_user }}{% endif %}
{%- if image.workdir %}WORKDIR {{ image.workdir }}{% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

currently we embed "WORKDIR" into "dockerfile_custom_end" which is a bit earlier in the order of Dockerfile statements than the new one you add here.

could you please convert the existing users (or at least one of them) over to the new attribute (e.g. src/bci_build/package/php.py and others) so that we can see that it works the same way? alternatively extend tests/test_build_recipe to have workdir defined also somewhere.

@dcermak
Copy link
Collaborator

dcermak commented Oct 23, 2024

Thanks for the PR @cwh42! Do you have a specific use case in mind, where the current approach of defining WORKINGDIR in the Dockerfile directly is insufficient?

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.

3 participants