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

docs imply copy option should work for host directory mounts. #16961

Closed
ykuksenko opened this issue Dec 31, 2022 · 5 comments · Fixed by #16991
Closed

docs imply copy option should work for host directory mounts. #16961

ykuksenko opened this issue Dec 31, 2022 · 5 comments · Fixed by #16991
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

@ykuksenko
Copy link

ykuksenko commented Dec 31, 2022

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

/kind bug

Description

Podman run docs imply that the copy option should work on host directory mounts. This does not actually work.

Steps to reproduce the issue:

mkdir test_volume
podman run --rm -ti -v $PWD/test_volume:/etc/yum.repos.d:copy fedora ls -la /etc/yum.repos.d
podman run --rm -ti fedora ls -la /etc/yum.repos.d

Describe the results you received:
In the first podman command you get an empty directory.

Describe the results you expected:
The second podman command shows the contents that I expected to be there. Namely yum repo configs.

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

Output of podman version:

Client:       Podman Engine
Version:      4.3.1
API Version:  4.3.1
Go Version:   go1.18.7
Built:        Fri Nov 11 15:24:13 2022
OS/Arch:      linux/amd64

Output of podman info:

host:
  arch: amd64
  buildahVersion: 1.28.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.5-1.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.5, commit: '
  cpuUtilization:
    idlePercent: 92.38
    systemPercent: 5.42
    userPercent: 2.2
  cpus: 2
  distribution:
    distribution: fedora
    variant: cloud
    version: "36"
  eventLogger: journald
  hostname: container.test.defray.org
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.0.15-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 1084809216
  memTotal: 6215737344
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.7.2-2.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.7.2
      commit: 0356bf4aff9a133d655dc13b1d9ac9424706cac4
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: 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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 6165098496
  swapTotal: 6214905856
  uptime: 28h 13m 59.00s (Approximately 1.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.test.defray.org:5000
  - registry-dockerhub.net.defray.org
  - registry-quayio.net.defray.org
  - registry-fedoraproject.net.defray.org
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 28
    paused: 0
    running: 27
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 170638946304
  graphRootUsed: 109593026560
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 176
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 1668180253
  BuiltTime: Fri Nov 11 15:24:13 2022
  GitCommit: ""
  GoVersion: go1.18.7
  Os: linux
  OsArch: linux/amd64
  Version: 4.3.1

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

 podman-4.3.1-1.fc36.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes

Additional environment details (AWS, VirtualBox, physical, etc.):
libvirt/vagrant deployment of fedora 36

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 31, 2022
@ykuksenko ykuksenko changed the title docs imply copy option should work for docs imply copy option should work for host directory mounts. Dec 31, 2022
@vrothberg
Copy link
Member

@mheon PTAL

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2023

Copy will not work on bind mounts, and we should throw an error. The issue is we don't want to copy content out of the image onto the volume since the volume is from the host, this is not something we want, and quite potentially not allowed. The intention for this option is for built in options where we create an empty directory, not for bind mount volumes.

@vrothberg
Copy link
Member

I'd also love to improve the documentation. It remains largely unclear what the option does (or I didn't find the right spot).

@ykuksenko
Copy link
Author

Is this at all different for nfs volumes?
(sudo podman volume create --opt type=nfs --opt o=rw --opt device=10.0.0.150:/nfs-share nfsvol)

rhatdan added a commit to rhatdan/podman that referenced this issue Jan 4, 2023
Fixes: containers#16961

Signed-off-by: Daniel J Walsh <[email protected]>
@mheon
Copy link
Member

mheon commented Jan 6, 2023

@ykuksenko Copy works for any volume created by podman volume create.

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