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

mount command does not work inside podman containers #10263

Closed
vikas-goel opened this issue May 7, 2021 · 4 comments · Fixed by #10270
Closed

mount command does not work inside podman containers #10263

vikas-goel opened this issue May 7, 2021 · 4 comments · Fixed by #10270
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

@vikas-goel
Copy link
Contributor

vikas-goel commented May 7, 2021

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

/kind bug

Description

When mount command is run inside containers managed by Podman, the command shows nothing. The command works and shows all the mount points when the same containers are managed by Docker.

In the absence of mount command output, the application inside the existing containers fail to work.

In Docker managed container, /etc/mtab is a symbolic link to /proc/mounts. Whereas, in Podman the symbolic link is missing. When the symbolic link is created manually in Podman managed container, the mount command works same as it does in Docker environment.

Podman environment

bash-4.2# ls -l /etc/mtab
-rw-r--r--. 1 root root 0 May  6 17:09 /etc/mtab
bash-4.2# mount
bash-4.2#
bash-4.2# ln -sf /proc/mount /etc/mtab
bash-4.2# mount
overlay on / type overlay (rw,relatime,context=system_u:object_r:container_file_ ...

Docker environment

bash-4.2# ls -l /etc/mtab
lrwxrwxrwx. 1 root root 12 Mar 28 01:16 /etc/mtab -> /proc/mounts
bash-4.2# mount
overlay on / type overlay (rw,relatime,context=system_u:object_r:container_file_t ...

Steps to reproduce the issue:

  1. Load a Red Hat based container image with mount package installed in Podman environment

  2. Run a container using the container image

  3. Run mount command inside the container

Describe the results you received:
The mount command shows no output

Describe the results you expected:
The mount command should show the mount points as available in /proc/mounts

Additional information you deem important (e.g. issue happens only occasionally):
The behavior is consistent and reproducible 100% of time

Output of podman version:

Version:      3.0.2-dev
API Version:  3.0.0
Go Version:   go1.15.7
Built:        Tue Mar  2 07:10:06 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.4
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.26-1.module+el8.4.0+10198+36d1d0e3.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.26, commit: 0a5175681bdd52b99f1f0f442cbba8f8c126a1c9'
  cpus: 8
  distribution:
    distribution: '"rhel"'
    version: "8.4"
  eventLogger: file
  hostname: flex-vm-02.dc2.ros2100.veritas.com
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-293.el8.x86_64
  linkmode: dynamic
  memFree: 14150402048
  memTotal: 33511845888
  ociRuntime:
    name: runc
    package: runc-1.0.0-70.rc92.module+el8.4.0+10198+36d1d0e3.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.2-dev'
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_NET_RAW,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 16921104384
  swapTotal: 16924012544
  uptime: 62h 1m 51.32s (Approximately 2.58 days)
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 5
    paused: 0
    running: 2
    stopped: 3
  graphDriverName: overlay
  graphOptions:
    overlay2.size: 10G
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 3
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1614697806
  BuiltTime: Tue Mar  2 07:10:06 2021
  GitCommit: ""
  GoVersion: go1.15.7
  OsArch: linux/amd64
  Version: 3.0.2-dev

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

podman-3.0.1-3.module+el8.4.0+10198+36d1d0e3.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

No

Additional environment details (AWS, VirtualBox, physical, etc.):
Red Hat Enterprise Linux 8.4 Beta
VMware virtual machine

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 7, 2021
@rhatdan
Copy link
Member

rhatdan commented May 7, 2021

What image are you seeing this with? When I look at fedora and alpine images, I see the link, but maybe these images come with the link.

@vikas-goel
Copy link
Contributor Author

The container image is built based off of RHEL 7.9.

bash-4.2# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
bash-4.2#

@mheon
Copy link
Member

mheon commented May 9, 2021 via email

rhatdan added a commit to rhatdan/podman that referenced this issue May 15, 2021
We should create the /etc/mtab->/proc/mountinfo link
so that mount command will work within the container.

Docker does this by default.

Fixes: containers#10263

Signed-off-by: Daniel J Walsh <[email protected]>
@vikas-goel
Copy link
Contributor Author

Thank you all.

mheon pushed a commit to mheon/libpod that referenced this issue Jun 24, 2021
We should create the /etc/mtab->/proc/mountinfo link
so that mount command will work within the container.

Docker does this by default.

Fixes: containers#10263

Signed-off-by: Daniel J Walsh <[email protected]>
pkegg pushed a commit to pkegg/AmberELEC that referenced this issue Aug 26, 2021
dhwz pushed a commit to AmberELEC/AmberELEC that referenced this issue Aug 28, 2021
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.

4 participants