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

Docker build fails when passed context that is located inside Virtualbox shared folder #279

Closed
pedropombeiro opened this issue Nov 10, 2020 · 4 comments

Comments

@pedropombeiro
Copy link

pedropombeiro commented Nov 10, 2020

The upgrade from Docker 19.03.05 in https://app.vagrantup.com/StefanScherer/boxes/windows_2019_docker/versions/2020.07.17 caused this Docker bug to surface in the Vagrant boxes.

It manifests itself when running a docker build command which uses a context path that is located inside a Virtualbox shared mount:

unable to prepare context: unable to evaluate symlinks in context path: CreateFile \\vboxsvr\C:_GitLab-Runnerdockerfiles: The network name cannot be found.

In this case, the C:\GitLab-Runner symlink points to \\vboxsvr\C:_GitLab-Runner but Docker joins the path without a slash, so instead of \\vboxsvr\C:_GitLab-Runner\dockerfiles it sees \\vboxsvr\C:_GitLab-Runnerdockerfiles.

See https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/2555 and https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27115 for more context.

@StefanScherer
Copy link
Owner

Do you know which box version you have used before the update?
It could also be related to VirtualBox 6 update. 🤔
I haven‘t used VirtualBox lately.
On which host OS do you encounter this problem?

@pedropombeiro
Copy link
Author

Do you know which box version you have used before the update?

I'm not sure exactly which box version I was using before the update, however I went back through box versions and confirmed that it was introduced with 2020.07.17. If I use 2020.04.15 then docker build works fine.

It could also be related to VirtualBox 6 update. 🤔

I don't think it is related to a VirtualBox upgrade because we've tried downgrading to a previous version and the problem still manifested itself.

On which host OS do you encounter this problem?

On MacOS 10.15.7

@StefanScherer
Copy link
Owner

Thanks. I've tried my latest box with VirtualBox on my Mac (StefanScherer/windows_2019_docker (virtualbox, 2020.09.22) with Docker EE 19.03.12) and for a simple test shared volumes work fine. Ah, I see, a docker build doesn't work as it cannot
It works with a Docker CLI 19.03.8 (Go version: go1.12.17), but fails with newer versions (Go version: go1.13.13)

I did some more investigation.

Tried the nightly build from https://master.dockerproject.org/, also fails. It's also compiled with Go 1.13.x

Tried to build a Docker CLI 19.03.12 with Go 1.12.17 (I used https://github.com/StefanScherer/docker-cli-builder to build the Docker CLI), and this works.

So it's a change in underlying Golang. 🤔

PS C:\Users\stefanscherer\code\dockerfiles-windows\node\12\nano> C:\Users\stefanscherer\code\docker-cli-builder\docker.exe version
Client:
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        0ed913b8-
 Built:             11/11/2020 09:03:35
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Enterprise
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.13.13
  Git commit:       f295753ffd
  Built:            08/05/2020 19:26:41
  OS/Arch:          windows/amd64
  Experimental:     false

PS C:\Users\stefanscherer\code\dockerfiles-windows\node\12\nano> C:\Users\stefanscherer\code\docker-cli-builder\docker-19.03.12-go1.12.7.exe build -t test .
Sending build context to Docker daemon  791.3MB
Step 1/26 : ARG core=mcr.microsoft.com/windows/servercore:ltsc2019
Step 2/26 : ARG target=mcr.microsoft.com/windows/nanoserver:1809
...

I also tried latest Golang, but it also fails

PS C:\Users\stefanscherer\code\dockerfiles-windows\node\12\nano> C:\Users\stefanscherer\code\docker-cli-builder\docker-19.03.12-go1.15.4.exe build -t test .
unable to prepare context: unable to evaluate symlinks in context path: CreateFile \\vboxsvr\Users_stefanscherercode: The network name cannot be found.

@pedropombeiro
Copy link
Author

Thanks for the thorough investigation @StefanScherer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants