Reputation: 35117
So the error I keep running into is:
COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builderXXXXXXXXX/MyProjectFolder/MyProjectFile.csproj
I've done a lot of googling and the common issues I'm seeing are things like path issues where the file exists and a simple adjustment to the path fixes the issue. In my case when I run bash inside the container and ls /mnt it's completely empty. There is no sda1 or anything.
So I have two questions:
docker build
command doesn't have a -v switch so I'm not sure how to accomplish that either.Hoping someone can give me a nudge in the right direction here. I can see the problem I just have no idea what configuration/settings/whatever I need to mess with to get it working.
EDIT: As I continue to poke around I did notice the first line of the docker build
command is Sending build context to Docker daemon xxxMB
. The size matches that of the project folder so the "Docker daemon" is getting the appropriate files. I have already tried doing a RUN find / -name "*.csproj"
(along with some other searches) command but it returns nothing. Is the daemon responsible for mounting the context in the container? What would cause that to (silently) fail?
Upvotes: 2
Views: 38
Reputation: 35117
So once I noticed the "Docker daemon" I started pulling on that thread and learned about the ADD command which seems to be the command for copying the build context to the container. I didn't see it anywhere in my Dockerfile so I gave it a try and suddenly I had access to the project files inside the container. I adjusted the failed COPY command to use this path and everything built as expected. I'm not sure why the Visual Studio project template doesn't do this for me but whatever.
Pretty excited to be past this hurdle.
Upvotes: 2