From f4bfce05e3ed2cf2ede507e4d2874090fa31b76a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 5 Sep 2022 09:51:57 +0200 Subject: [PATCH] org.osbuild.oci-archive: Support setting Entrypoint This allows setting Entrypoint (as well as Cmd) in the oci image, as per the spec: https://github.com/opencontainers/image-spec/blob/main/config.md Note: These two are not equivalent, the Cmd part is replaced by the argument on the `docker run` commandline, whereas the entrypoint is kept from the config, so it is important to expose both of these. --- assemblers/org.osbuild.oci-archive | 8 +++++++- stages/org.osbuild.oci-archive | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assemblers/org.osbuild.oci-archive b/assemblers/org.osbuild.oci-archive index 77262e8e..83c061e0 100755 --- a/assemblers/org.osbuild.oci-archive +++ b/assemblers/org.osbuild.oci-archive @@ -58,6 +58,12 @@ SCHEMA = """ "type": "string" } }, + "Entrypoint": { + "type": "array", + "items": { + "type": "string" + } + }, "Env": { "type": "array", "default": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], @@ -181,7 +187,7 @@ def config_from_options(options): "Cmd": command } - for name in ["User", "Labels", "StopSignal", "WorkingDir"]: + for name in ["Entrypoint", "User", "Labels", "StopSignal", "WorkingDir"]: item = options.get(name) if item: config[name] = item diff --git a/stages/org.osbuild.oci-archive b/stages/org.osbuild.oci-archive index 13f8c9d7..d490c3a4 100755 --- a/stages/org.osbuild.oci-archive +++ b/stages/org.osbuild.oci-archive @@ -76,6 +76,12 @@ SCHEMA_2 = r""" "type": "string" } }, + "Entrypoint": { + "type": "array", + "items": { + "type": "string" + } + }, "Env": { "type": "array", "default": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], @@ -255,7 +261,7 @@ def config_from_options(options): "Cmd": command } - for name in ["User", "Labels", "StopSignal", "WorkingDir"]: + for name in ["Entrypoint", "User", "Labels", "StopSignal", "WorkingDir"]: item = options.get(name) if item: config[name] = item