Skip to content

Conversation

@cwh42
Copy link

@cwh42 cwh42 commented Oct 23, 2024

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

{%- 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