# Step 1: build a dummy image with ENTRYPOINT and CMD container="$(buildah from "docker.io/library/ubuntu:18.04")" buildah config \ --entrypoint '["/bin/bash", "-e", "/entrypoint.sh"]' \ --cmd "/mycommand" \ "$container" image="localhost/myuser/myimage:latest" buildah commit --rm "$container" "$image" podman tag "$image" "localhost/myuser/myimage:original" # Step 2: inspect the image (all good here) podman inspect --format="{{.Config.Entrypoint}}" "$image" # prints: [/bin/bash -e /entrypoint.sh] podman inspect --format="{{.Config.Cmd}}" "$image" # prints: [/mycommand] # Step 3: make a container from the image # Note that the ENTRYPOINT gets prepended to the CMD container="$(podman container create "$image")" podman inspect --format="{{.Config.Entrypoint}}" "$container" # prints: /bin/bash -e /entrypoint.sh podman inspect --format="{{.Config.Cmd}}" "$container" # prints: [/bin/bash -e /entrypoint.sh /mycommand] podman commit "$container" "$image" # Step 4: check the resulting image (the problem persists) podman inspect --format="{{.Config.Entrypoint}}" "$image" # prints: [/bin/bash -e /entrypoint.sh] podman inspect --format="{{.Config.Cmd}}" "$image" # prints: [/bin/bash -e /entrypoint.sh /mycommand] # Step 5: repeat step 3, and note that the ENTRYPOINT is prepended again container="$(podman container create "$image")" podman inspect --format="{{.Config.Entrypoint}}" "$container" # prints: /bin/bash -e /entrypoint.sh podman inspect --format="{{.Config.Cmd}}" "$container" # prints: [/bin/bash -e /entrypoint.sh /bin/bash -e /entrypoint.sh /mycommand] podman commit "$container" "$image" # Step 6: re-inspect, this starts to be a problem podman inspect --format="{{.Config.Entrypoint}}" "$image" # prints: [/bin/bash -e /entrypoint.sh] podman inspect --format="{{.Config.Cmd}}" "$image" # prints: [/bin/bash -e /entrypoint.sh /bin/bash -e /entrypoint.sh /mycommand] # Step 7: for comparison, test with buildah (no problem here) container="$(buildah from "localhost/myuser/myimage:original")" buildah commit --rm "$container" "$image" podman inspect --format="{{.Config.Entrypoint}}" "$image" # prints: [/bin/bash -e /entrypoint.sh] podman inspect --format="{{.Config.Cmd}}" "$image" # prints: [/mycommand]