containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.83k stars 2.42k forks source link

`podman cp <image>:/home/user/path .` doesn't work #4752

Closed XVilka closed 4 years ago

XVilka commented 4 years ago

/kind bug

Description

On par with docker podman should support copy in the format

podman cp <image>:/home/user/path .

Steps to reproduce the issue:

  1. podman cp <image>:/home/user/path .

  2. Get the error

Describe the results you received:

Error: you must provide a source path and a destination path

Describe the results you expected: Should copy the files

Additional information you deem important (e.g. issue happens only occasionally): Output of podman version:

Version: 1.6.2
RemoteAPI Version: 1
Go Version: go1.13.1
OS/Arch: linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.13.1
  podman version: 1.6.2
host:
  BuildahVersion: 1.11.3
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.2-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.2, commit: 186a550ba0866ce799d74006dab97969a2107979'
  Distribution:
    distribution: fedora
    version: "31"
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 2000544
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 2000544
      size: 65536
  MemFree: 1802358784
  MemTotal: 16675573760
  OCIRuntime:
    name: crun
    package: crun-0.10.2-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.10.2
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 8370253824
  SwapTotal: 8426352640
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: localhost.localdomain
  kernel: 5.3.7-301.fc31.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.0-20.1.dev.gitbbd6f25.fc31.x86_64
    Version: |-
      slirp4netns version 0.4.0-beta.3+dev
      commit: bbd6f25c70d5db2a1cd3bfb0416a8db99a75ed7e
  uptime: 25h 7m 34.1s (Approximately 1.04 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/akochkov/.config/containers/storage.conf
  ContainerStore:
    number: 33
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.6.5-2.fc31.x86_64
      Version: |-
        fusermount3 version: 3.6.2
        fuse-overlayfs: version 0.6.5
        FUSE library version 3.6.2
        using FUSE kernel interface version 7.29
  GraphRoot: /home/akochkov/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 82
  RunRoot: /run/user/1000
  VolumePath: /home/akochkov/.local/share/containers/storage/volumes

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

podman-1.6.2-2.fc31.x86_64
rhatdan commented 4 years ago

@QiWang19 PTAL

QiWang19 commented 4 years ago

@XVilka This error might be caused by incorrect argument length. Did you forget the space between the arguments? https://github.com/containers/libpod/blob/f57fdd038d431ebbd59e39b909cab7543b5d8f01/cmd/podman/cp.go#L63-L65

mheon commented 4 years ago

@XVilka Are you asking to copy files from an image, instead of a container? I don't believe that docker cp presently provides that functionality (it's restricted to containers, as is our implementation)?

XVilka commented 4 years ago

@mheon no, I try to copy from the running container, sorry if it wasn't clear.

github-actions[bot] commented 4 years ago

A friendly reminder that this issue had no activity for 30 days.

rhatdan commented 4 years ago

@QiWang19 Any movement on this one?

QiWang19 commented 4 years ago

I failed to replicate this issue.

XVilka commented 4 years ago

I will have access to the machine with this issue only after Feb 24, sorry.

jvanz commented 4 years ago

I cannot simulate in the latest master branch.

rhatdan commented 4 years ago

Seems to work in master. Closing.