diff --git a/src/bci_build/package.py b/src/bci_build/package.py
index 4fefc35e3..16e6d658b 100755
--- a/src/bci_build/package.py
+++ b/src/bci_build/package.py
@@ -141,6 +141,9 @@ class BaseContainerImage(abc.ABC):
#: An optional entrypoint for the image, it is omitted if empty or ``None``
entrypoint: Optional[str] = None
+ #: An optional CMD for the image, it is omitted if empty or ``None``
+ cmd: Optional[str] = None
+
#: Extra environment variables to be set in the container
env: Union[Dict[str, Union[str, int]], Dict[str, str], Dict[str, int]] = field(
default_factory=dict
diff --git a/src/bci_build/templates.py b/src/bci_build/templates.py
index 36d4ef1d8..1aa587264 100644
--- a/src/bci_build/templates.py
+++ b/src/bci_build/templates.py
@@ -33,6 +33,7 @@
{{ image.env_lines }}
{% if image.entrypoint -%}ENTRYPOINT {{ image.entrypoint }}{% endif %}
+{% if image.cmd -%}CMD {{ image.cmd }}{% endif %}
{{ image.dockerfile_custom_end }}
"""
)
@@ -76,7 +77,8 @@
{{ image.extra_label_xml_lines }}
-{% if image.entrypoint %} {% endif %}
+{% if image.cmd %} {% endif %}
+{% if image.entrypoint %} {% endif %}
{{ image.kiwi_env_entry }}