diff --git a/src/bci_build/package/__init__.py b/src/bci_build/package/__init__.py index d65e0b84b..04649a967 100644 --- a/src/bci_build/package/__init__.py +++ b/src/bci_build/package/__init__.py @@ -193,6 +193,9 @@ class BaseContainerImage(abc.ABC): # The user to use for entrypoint service entrypoint_user: str | None = "" + # An optional workdir for the entrypoint or CMD + workdir: str | None = "" + #: An optional CMD for the image, it is omitted if empty or ``None`` cmd: list[str] | None = None diff --git a/src/bci_build/templates.py b/src/bci_build/templates.py index 4d3281832..5f0016d81 100644 --- a/src/bci_build/templates.py +++ b/src/bci_build/templates.py @@ -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 %} {%- if image.volume_dockerfile %}{{ image.volume_dockerfile }}{% endif %} """ ) @@ -137,6 +138,9 @@ {%- if image.entrypoint_user %} user="{{ image.entrypoint_user }}" {%- endif %} +{%- if image.workdir %} + workingdir="{{ image.workdir }}" +{%- endif %} {#- NOTE: eye sight chart: this has a closing element character '>' here: ----> -#} >