-1

I'm looking for a way to copy a file from container A to container B within a Dockerfile.

Inside the Dokerfile I write this code but it fails:

COPY containersource:/mypath/filename.properties containerdest:/path/cfg/
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Alex
  • 187
  • 1
  • 9

1 Answers1

2

If you want to copy from container image to container image, you write in the dockerfile

FROM fedora:rawhide as source
FROM fedora:38
COPY --from=source /etc/fedora-release /path/cfg/

If indeed you want to copy from container to container, you use

podman cp containersource:/mypath/filename.properties containerdest:/path/cfg/
raywib
  • 33
  • 6