R
RunPod4mo ago
abelko

File copying does not occur in Custom Template

I have been successfully using runpod with a custom template until recently when it stopped working properly. Upon investigation, I discovered an issue where the project code was not being copied correctly into the pod. To identify the bug, I created a very simple image and attempted to copy test.txt as an experiment, but the file was not copied into the pod. On my personal GPU server, the test Dockerfile worked perfectly, and test.txt was copied successfully. I wonder why the code is not being copied only in runpod...? Below is my test Dockerfile code.
FROM ubuntu:22.04

WORKDIR /workspace

COPY ./test.txt .

CMD tail -f /dev/null
FROM ubuntu:22.04

WORKDIR /workspace

COPY ./test.txt .

CMD tail -f /dev/null
4 Replies
abelko
abelko4mo ago
This is my Custom Template
No description
ashleyk
ashleyk4mo ago
Your volume mount path conflicts with the /workspace of the Docker image, they should use two different paths. Usually the Docker image uses a WORKDIR of / instead of /workspace and then does an rsync from / to /workspace to work around this.
abelko
abelko4mo ago
Thank you for the answer! Originally, it was working fine with the existing settings. In Docker, the WORKDIR was set to /workspace, and in RunPod, the volume mount path was set to /workspace, and it worked well. However, at some point, the volume mount path started to overwrite. I am certain that the code on the RunPod side related to this has been changed. Is that correct?
justin
justin4mo ago
No That is not correct This is always the behavior, and this is the behavior that volume mounts are in docker, u can google / search this up anytime u mount a volume over a folder, this is just the way it is - from what i remember when i asked chatgpt before its called "overshadowing a folder" or something like that. ive also been confused on this and made a post on this before wondering the same and have the same issue + other people so this has always been the case