Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change CMD in podman commit if it has arguments #2951

Closed
AlekseyUsov opened this issue Apr 16, 2019 · 1 comment
Closed

Unable to change CMD in podman commit if it has arguments #2951

AlekseyUsov opened this issue Apr 16, 2019 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@AlekseyUsov
Copy link

/kind bug

Description

Unable to set CMD in a created container before committing it into image if it contains multiple elements, like /usr/sbin/httpd -D FOREGROUND. I tried several variations, like using single and double quotes, omitting square brackets, etc, but to no avail.

Steps to reproduce the issue:

# podman ps -a
CONTAINER ID  IMAGE                       COMMAND               CREATED      STATUS                  PORTS  NAMES
07bea49b4256  docker.io/library/centos:7  /bin/bash -c yum ...  5 hours ago  Exited (0) 5 hours ago         friendly_goldstine

# podman commit -c CMD=["/usr/sbin/httpd","-D","FOREGROUND"] 07bea49b4256 myhttpd
Getting image source signatures
Skipping fetch of repeat blob sha256:d69483a6face4499acb974449d1303591fcbb5cdce5420f36f8a6607bda11854
Skipping fetch of repeat blob sha256:8996bcacb91f6a5089ec53c2bb73ad6c4922ce881a9d45eb801b2df737295ad2
Copying config sha256:36d293f5ae4b6c41a7aaf0a06d4e66ee312a9c6b9f8448422fd03051af5e08cb
 1.25 KB / 1.25 KB [========================================================] 0s
Writing manifest to image destination
Storing signatures
36d293f5ae4b6c41a7aaf0a06d4e66ee312a9c6b9f8448422fd03051af5e08cb

Describe the results you received:

# podman run -d --name httpd -p 8080:80 myhttpd
container create failed: container_linux.go:336: starting container process caused "exec: \"[/usr/sbin/httpd,-D,FOREGROUND]\": stat [/usr/sbin/httpd,-D,FOREGROUND]: no such file or directory"
: internal libpod error

# podman inspect myhttpd
...
"Cmd": [
                "[/usr/sbin/httpd,-D,FOREGROUND]"
            ],
...

Describe the results you expected:
podman inspect myhttpd should return CMD in its output as a properly formatted JSON array with httpd binary and its arguments as separate elements:

"Cmd": [
                "/usr/sbin/httpd",
                "-D",
                "FOREGROUND"
            ],

Also, podman run -d --name httpd -p 8080:80 myhttpd should start the container and output its ID.

Additional information you deem important (e.g. issue happens only occasionally):
The issue is persistent.

Output of podman version:

Version:       0.12.1.2
Go Version:    go1.10.3
OS/Arch:       linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.10.3
  podman version: 0.12.1.2
host:
  BuildahVersion: 1.6-dev
  Conmon:
    package: podman-0.12.1.2-2.git9551f6b.el7.centos.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.12.0-dev, commit: b909c9e1a3e8f14d5694a118fb9c0c0325a31d4f-dirty'
  Distribution:
    distribution: '"centos"'
    version: "7"
  MemFree: 2968625152
  MemTotal: 3973599232
  OCIRuntime:
    package: runc-1.0.0-59.dev.git2abd837.el7.centos.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.0'
  SwapFree: 2147479552
  SwapTotal: 2147479552
  arch: amd64
  cpus: 2
  hostname: node1.172.24.0.11.nip.io
  kernel: 3.10.0-957.5.1.el7.x86_64
  os: linux
  rootless: false
  uptime: 5h 38m 38.79s (Approximately 0.21 days)
insecure registries:
  registries: []
registries:
  registries:
  - registry.access.redhat.com
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.centos.org
store:
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
  ImageStore:
    number: 8
  RunRoot: /var/run/containers/storage

Additional environment details (AWS, VirtualBox, physical, etc.):
Running on CentOS 7.6.1810 managed by Vagrant.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2019
@mheon
Copy link
Member

mheon commented Apr 25, 2019

Fix merged

@mheon mheon closed this as completed Apr 25, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

3 participants