RogerioLSantos
Mission Specialist
Mission Specialist
  • 808 Views

Podman COPY file

Jump to solution

Hi Guys, a question about COPY command inside Containerfile

is it mandatory that the file I want to copy be in the same folder as the Containerfile/Dockerfile file?

I ask that because in my Containerfile I put the instruction COPY
/home/user/Downloads/file.zip /opt/, however when I run the command podman build, I receive an error message: no such file or directory , however, the file exists in the folder /home/user/Downloads/

 

 

Labels (1)
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
vikassharma
Mission Specialist
Mission Specialist
  • 802 Views

Re: Podman COPY file

Jump to solution

Hi RogerioLSantos,

Where is your dockerfile exists?

the folder /home/user/Downloads/file.zip should be into the same context as of dockerfile. Please go through the github issue which was raised for the same.

https://github.com/moby/moby/issues/4592

~Vikas Sharma

View solution in original post

Reply
Loading...
3 Replies
vikassharma
Mission Specialist
Mission Specialist
  • 803 Views

Re: Podman COPY file

Jump to solution

Hi RogerioLSantos,

Where is your dockerfile exists?

the folder /home/user/Downloads/file.zip should be into the same context as of dockerfile. Please go through the github issue which was raised for the same.

https://github.com/moby/moby/issues/4592

~Vikas Sharma

Reply
Loading...
RogerioLSantos
Mission Specialist
Mission Specialist
  • 789 Views

Re: Podman COPY file

Jump to solution

Hi vikassharma, my /home/user/Downloads/file.zip is in a different context

I thought that COPY would read any folder in the host.

In this structure works

Captura de tela de 2022-01-25 10-38-11.png

 

However, I was trying to use a folder outside of this context, because I thought that COPY has visibility of all folders in the host.

 

 

 

 

 

 

 

 

 

0 Kudos
Reply
Loading...
Petronela
Cadet
Cadet
  • 250 Views

Re: Podman COPY file

Jump to solution

You can't COPY a zip! You need ADD! And add does not work with zip, but with .tar

And you need all of it in the current dir where you execute the build command.

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.