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 run ignores stdin #3880

Closed
matpen opened this issue Aug 23, 2019 · 3 comments
Closed

Podman run ignores stdin #3880

matpen opened this issue Aug 23, 2019 · 3 comments
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

@matpen
Copy link

matpen commented Aug 23, 2019

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

/kind bug

Description

Seems like podman run ignores stdin.

Steps to reproduce the issue:

  1. Execute:
podman run --rm docker.io/library/ubuntu:18.04 bash <<< "echo hello world!"

and observe that there is no output.

  1. Compare with the analogous command performed with buildah:
buildah run "$(buildah from docker.io/library/ubuntu:18.04)" bash <<< "echo hello world!"

which correctly prints "hello world!".

Describe the results you received:

No output from the above, seems like stdin is not forwarded to the container command.

Describe the results you expected:

The command should print "hello world", in the same way as it happens with buildah run.

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

I seem to recall that buildah had the same issue originally, which has been fixed in relation to containers/buildah#1650 (and possibly others).

Output of podman version:

Version:            1.5.0
RemoteAPI Version:  1
Go Version:         go1.10.4
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.10.4
  podman version: 1.5.0
host:
  BuildahVersion: 1.10.1
  Conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.0, commit: unknown'
  Distribution:
    distribution: ubuntu
    version: "18.04"
  MemFree: 1159499776
  MemTotal: 16673423360
  OCIRuntime:
    package: 'runc: /usr/sbin/runc'
    path: /usr/sbin/runc
    version: 'runc version spec: 1.0.1-dev'
  SwapFree: 16783503360
  SwapTotal: 17036734464
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: matteo-laptop
  kernel: 5.0.0-25-generic
  os: linux
  rootless: true
  uptime: 10h 29m 45.89s (Approximately 0.42 days)
registries:
  blocked: null
  insecure: null
  search: null
store:
  ConfigFile: /home/matteo/.config/containers/storage.conf
  ContainerStore:
    number: 15
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/matteo/MyData/data/podman/matteo
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 16
  RunRoot: /run/user/1000
  VolumePath: /home/matteo/.local/share/containers/storage/volumes

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

podman/bionic,now 1.5.0-2~ubuntu18.04~ppa5 amd64 [installed]

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

Physical host (laptop) with podman and buildah from PPA.
Output of buildah version:

Version:         1.10.1
Go Version:      go1.10.4
Image Spec:      1.0.1
Runtime Spec:    1.0.1-dev
CNI Spec:        0.4.0
libcni Version:  
Git Commit:      
Built:           Thu Aug  8 22:29:48 2019
OS/Arch:         linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 23, 2019
@mheon
Copy link
Member

mheon commented Aug 23, 2019

Podman and Docker behave the exact same here, so I'd say this is expected behavior for that command. Add -i to your command like to keep STDIN open and it will work as expected.

The lack of compatability with Buildah here is a bit concerning, but our goal is to match Docker's command line, not Buildah's. @TomSweeneyRedHat Any thoughts here?

@TomSweeneyRedHat
Copy link
Member

As long as Docker and Podman's behavior is the same, then I'm good. The run command is one that differs between Buildah and Podman. In short Buildah's run command is supposed to emulate the "RUN" command found in a Dockerfile while Podman's is meant to handle running the container from the command line. Different beasts as far as how they each handle IO.

@nalind any other highlight that I missed?

@matpen
Copy link
Author

matpen commented Aug 23, 2019

Add -i to your command like to keep STDIN open and it will work as expected.

This indeed works. Thanks for the hint!

@rhatdan rhatdan closed this as completed Aug 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 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

No branches or pull requests

5 participants