/kind bug
Description
When using podman commit it stores the Cmd used to launch the committed container. It seems that it it impossible to make it null-out the Cmd in the resulting image.
Steps to reproduce the issue:
-
Create a container:
$ sudo podman run -i --name foo-c centos:8 bash -xc 'echo foo > /bar.sh'
+ echo foo
-
Commit it:
$ sudo podman commit foo-c foo-img
Getting image source signatures
Copying blob 9e607bb861a7 skipped: already exists
Copying blob 45de37606893 done
Copying config a9b00dc0f2 done
Writing manifest to image destination
Storing signatures
a9b00dc0f237b062e80669827e14321a2e18d9047ee21e00611f22f386105976
-
Resulting image has Cmd field set:
$ sudo podman image inspect foo-img -f json | jq -Mc '.[0].Config.Cmd'
["bash","-xc","echo foo > /bar.sh"]
-
Now lets try to make it null:
$ sudo podman commit --change 'CMD []' foo-c foo-img
...
-
The result is that Cmd becomes an array with an empty string in it instead of an empty array or being not included in the image altogether.:
$ sudo podman image inspect foo-img -f json | jq -Mc '.[0].Config.Cmd'
[""]
Additional information you deem important (e.g. issue happens only occasionally):
This mat or may not be related to this old Docker bug: moby/moby#7798
Output of podman version:
Output of podman info --debug:
debug:
compiler: gc
git commit: ""
go version: go1.10.8
podman version: 1.4.4
host:
BuildahVersion: 1.9.0
Conmon:
package: podman-1.4.4-2.el7.x86_64
path: /usr/libexec/podman/conmon
version: 'conmon version 0.3.0, commit: unknown'
Distribution:
distribution: '"rhel"'
version: "7.6"
MemFree: 2197884928
MemTotal: 24744050688
OCIRuntime:
package: runc-1.0.0-59.dev.git2abd837.el7.x86_64
path: /usr/bin/runc
version: 'runc version spec: 1.0.0'
SwapFree: 7883956224
SwapTotal: 8589930496
arch: amd64
cpus: 8
hostname: bkorren.tlv.csb
kernel: 3.10.0-957.21.3.el7.x86_64
os: linux
rootless: false
uptime: 960h 28m 45.56s (Approximately 40.00 days)
registries:
blocked: null
insecure: null
search:
- registry.access.redhat.com
- docker.io
- registry.fedoraproject.org
- quay.io
- registry.centos.org
store:
ConfigFile: /etc/containers/storage.conf
ContainerStore:
number: 5
GraphDriverName: overlay
GraphOptions: null
GraphRoot: /var/lib/containers/storage
GraphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
ImageStore:
number: 182
RunRoot: /var/run/containers/storage
VolumePath: /var/lib/containers/storage/volumes
Package info (e.g. output of rpm -q podman or apt list podman):
podman-1.4.4-2.el7.x86_64
/kind bug
Description
When using
podman commitit stores theCmdused to launch the committed container. It seems that it it impossible to make it null-out the Cmd in the resulting image.Steps to reproduce the issue:
Create a container:
Commit it:
Resulting image has
Cmdfield set:Now lets try to make it null:
The result is that
Cmdbecomes an array with an empty string in it instead of an empty array or being not included in the image altogether.:Additional information you deem important (e.g. issue happens only occasionally):
This mat or may not be related to this old Docker bug: moby/moby#7798
Output of
podman version:Output of
podman info --debug:Package info (e.g. output of
rpm -q podmanorapt list podman):