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

podman play kube doesn't ignore dockerfile ENTRYPOINT #6995

Closed
kaiyasuda opened this issue Jul 16, 2020 · 3 comments · Fixed by #7002
Closed

podman play kube doesn't ignore dockerfile ENTRYPOINT #6995

kaiyasuda opened this issue Jul 16, 2020 · 3 comments · Fixed by #7002
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

@kaiyasuda
Copy link

kaiyasuda commented Jul 16, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
podman play kube doesn't ignore dockerfile ENTRYPOINT when command parameter set. just append.
This difference between Podman and Kubernetes means there is an incompatibility between the Kubernetes YAML files that work with Podman and those that work with Kubernetes.

Steps to reproduce the issue:

  1. make pod with podman play kube
# podman play kube ipc.yml
# cat ipc.yml
apiVersion: v1
kind: Pod
metadata:
  name: mc2
spec:
  containers:
  - name: producer
    image: allingeek/ch6_ipc
    command: ["./ipc", "-producer"]
  - name: consumer
    image: allingeek/ch6_ipc
    command: ["./ipc", "-consumer"]
  restartPolicy: Never

./ipc is binary file to demonstrate Inter Process Communication(IPC) in pod.
This binary requires argments either "-consumer" or "-producer".

Describe the results you received:

but these containers don't work.
because argments of ./ipc is "./ipc -consumer" or "./ipc -producer."

# podman container ls -a --format "{{.Names}} {{.Command}}"
NAMES                 COMMAND
mc2-producer     ./ipc ./ipc -prod...
mc2-consumer    ./ipc ./ipc -cons...

Describe the results you expected:

According to Kubernetes Documentation,

If you supply a command and args, the default Entrypoint and the default Cmd defined in the Docker image are ignored. Your command is run with your args.

but podman doesn't ignore dockerfile ENTRYPOINT, just append.

This difference between Podman and Kubernetes means there is an incompatibility between the Kubernetes YAML files that work with Podman and those that work with Kubernetes.

Output of podman version:

# podman version
Version:      2.0.2
API Version:  1
Go Version:   go1.13.4
Built:        Wed Dec 31 19:00:00 1969
OS/Arch:      linux/amd64

Output of podman info --debug:

# podman info --debug
host:
  arch: amd64
  buildahVersion: 1.15.0
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.19-1.el8.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.19, commit: 4726cba6f219c7479c28f0687868bd2ffe894869'
  cpus: 2
  distribution:
    distribution: '"centos"'
    version: "8"
  eventLogger: file
  hostname: ycentos8.example.com
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-147.el8.x86_64
  linkmode: dynamic
  memFree: 5870723072
  memTotal: 8191717376
  ociRuntime:
    name: runc
    package: runc-1.0.0-60.rc8.module_el8.1.0+237+63e26edc.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.1-dev'
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  rootless: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 6874460160
  swapTotal: 6874460160
  uptime: 25h 53m 59.91s (Approximately 1.04 days)
registries:
  search:
  - registry.redhat.io
  - registry.access.redhat.com
  - quay.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 1
    stopped: 3
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 11
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 1
  Built: 0
  BuiltTime: Wed Dec 31 19:00:00 1969
  GitCommit: ""
  GoVersion: go1.13.4
  OsArch: linux/amd64
  Version: 2.0.2

Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.0.2-2.el8.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):
VMware, CentOS8

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 16, 2020
@kaiyasuda kaiyasuda changed the title podman play kube doesn't override dockerfile ENTRYPOINT podman play kube doesn't ignore dockerfile ENTRYPOINT Jul 16, 2020
@mheon
Copy link
Member

mheon commented Jul 16, 2020

I distinctly recall getting another issue about the exact opposite of this.

@haircommander How does CRI-O handle this, if I might ask?

@haircommander
Copy link
Collaborator

if command is specified, it replaces ENTRYPOINT.

ref: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes

this should be fixed as a consequence of @ryanchpowell fixing #5730

@zhangguanzhang
Copy link
Collaborator

pod's command override the image's Entrypoint
pod's args override the image's Command

@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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

Successfully merging a pull request may close this issue.

5 participants