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 creates directory when copying a file from and to container #3384

Closed
sshnaidm opened this issue Jun 20, 2019 · 2 comments · Fixed by #3391
Closed

Podman creates directory when copying a file from and to container #3384

sshnaidm opened this issue Jun 20, 2019 · 2 comments · Fixed by #3391
Assignees
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

@sshnaidm
Copy link
Member

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

/kind bug

Description

when podman copies file to/from container, it creates a directory with the same name on destination and copies file to it
Steps to reproduce the issue:

echo "blabla" > /tmp/bla
podman cp --pause=false /tmp/bla instance:/root/
podman exec -it instance ls -lash /root/
4.0K drwx------.  2 root root 4.0K Jun 20 17:07 bla

podman exec -it instance ls -lash /root/bla
total 12K
4.0K drwx------. 2 root root 4.0K Jun 20 17:07 .
4.0K dr-xr-x---. 6 root root 4.0K Jun 20 17:07 ..
4.0K -rw-rw-r--. 1 root root    7 Jun 20 17:07 bla

Exactly the same thing when copying file from container to host.

Describe the results you received:
Directories with files

Describe the results you expected:
Just files

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

Output of podman version:

podman version 1.4.0

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.11.10
  podman version: 1.4.0
host:
  BuildahVersion: 1.8.3
  Conmon:
    package: podman-1.4.0-2.fc29.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 0.2.0, commit: 80f19b1591b03dbbc53bf28b154230c7ea372281'
  Distribution:
    distribution: fedora
    version: "29"
  MemFree: 362270720
  MemTotal: 25142366208
  OCIRuntime:
    package: runc-1.0.0-93.dev.gitb9b6cc6.fc29.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc8+dev
      commit: 82f4855a8421018c9f4d74fbcf2da7f8ad1e11fa
      spec: 1.0.1-dev
  SwapFree: 10366218240
  SwapTotal: 12645822464
  arch: amd64
  cpus: 4
  hostname: sshnaidm.remote
  kernel: 5.1.8-200.fc29.x86_64
  os: linux
  rootless: true
  uptime: 173h 16m 38.78s (Approximately 7.21 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/sshnaidm/.config/containers/storage.conf
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/sshnaidm/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 26
  RunRoot: /tmp/1000
  VolumePath: /home/sshnaidm/.local/share/containers/storage/volumes

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 20, 2019
QiWang19 added a commit to QiWang19/podman that referenced this issue Jun 20, 2019
close containers#3384

Signed-off-by: Qi Wang <qiwan@redhat.com>
debarshiray added a commit to containers/toolbox that referenced this issue Jun 26, 2019
Copying files into a running container is considered inherently hacky.
Rootful Podman can pause a container using 'podman cp --pause ...'
during the copy, but that's not possible when used rootless.

Secondly 'podman cp' has suffered from a series of regressions lately.
First there was the problem with how the --pause flag was handled [1],
and then /etc/profile.d/toolbox.sh was getting created as a
directory [2], not regular file, by:
  $ podman cp \
            --pause=false \
            /etc/profile.d/toolbox.sh \
            "$container":/etc/profile.d

Try to side-step all that by using $XDG_RUNTIME_DIR as a conduit to
share the file with the container and using plain cp(1) to place it in
the toolbox container's /etc/profile.d.

[1] Commit e715ff2
    https://github.com/debarshiray/toolbox/pull/193

[2] containers/podman#3384

https://github.com/debarshiray/toolbox/issues/196
@medyagh
Copy link

medyagh commented Feb 11, 2020

I still have this issue with podman 1.8

@QiWang19
Copy link
Collaborator

I still have this issue with podman 1.8

This has been dixed. Can you privide your steps to reproduce the issue?

@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.

4 participants