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

Windows nested docker panic() on build on bound volumes #25440

Closed
sitano opened this issue Aug 5, 2016 · 5 comments
Closed

Windows nested docker panic() on build on bound volumes #25440

sitano opened this issue Aug 5, 2016 · 5 comments
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. platform/windows version/master

Comments

@sitano
Copy link

sitano commented Aug 5, 2016

Calling docker build . from bound volume from inside the container panics docker client. Calling the same thing from the copy of the volume works fine.

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0xbe20e0, 0xc08200c020)
        /usr/local/go/src/runtime/panic.go:481 +0x3f4
syscall./usr/local/go/src/syscall/syscall_windows.go:1031 +0x4e9x0, 0x0, 0x0)
os.Readlink(0xc0823049c0, 0x19, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/os/file_posix.go:21 +0xc4
path/fil/usr/local/go/src/path/filepath/symlink.go:47 +0x20c, 0x0, 0x0, 0x0, 0x0)
path/filepath.walkLinks(0xc082312390, 0x19, 0xc0821bad58, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/path/filepath/symlink.go:77 +0x422
path/fil/usr/local/go/src/path/filepath/symlink.go:68 +0x2190, 0x0, 0x0, 0x0)
path/filepath.walkLinks(0xc082312390, 0x21, 0xc0821bad58, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/path/filepath/symlink.go:73 +0x2df
path/filepath.walkSymlinks(0xc082312390, 0x21, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/path/filepath/symlink.go:98 +0xae
path/filepath.evalSymlinks(0xc082312390, 0x21, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/path/filepath/symlink_windows.go:50 +0x5d
path/fil/usr/local/go/src/path/filepath/path.go:227 +0x4a0x0, 0x0)
github.com/docker/docker/builder.getDockerfileRelPath(0xc08200c1e4, 0x1, 0x0, 0x0, 0xc082312390, 0x21, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/docker/builder/context.go:188 +0x35d
github.com/docker/docker/builder.GetContextFromLocalDir(0xc08200c1e4, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/docker/builder/context.go:169 +0x1fe
github.com/docker/docker/api/client/image.runBuild(0xc082066510, 0xc08200c1e4, 0x1, 0x0, 0x0, 0xc0822d9dc0, 0xe694d0, 0x113d580, 0x0, 0x0, ...)
        /go/src/github.com/docker/docker/api/client/image/build.go:139 +0x2796
github.com/docker/docker/api/client/image.NewBuildCommand.func1(0xc0822fc900, 0xc0822f8ee0, 0x1, 0x1, 0x0, 0x0)
        /go/src/github.com/docker/docker/api/client/image/build.go:75 +0xa3
github.c/go/src/github.com/docker/docker/vendor/src/github.com/spf13/cobra/command.go:593 +0x705
github.c/go/src/github.com/docker/docker/vendor/src/github.com/spf13/cobra/command.go:683 +0x563
github.com/spf13/cobra.(*Command).Execute(0xc082001b00, 0x0, 0x0)
        /go/src/github.com/docker/docker/vendor/src/github.com/spf13/cobra/command.go:642 +0x34
github.com/docker/docker/cli/cobraadaptor.CobraAdaptor.run(0xc082001b00, 0xc082066510, 0xc08200c1b8, 0x5, 0xc082003f40, 0x1, 0x1, 0x0, 0x0)
        /go/src/github.com/docker/docker/cli/cobraadaptor/adaptor.go:121 +0x266
github.com/docker/docker/cli/cobraadaptor.CobraAdaptor.Command.func1(0xc082003f40, 0x1, 0x1, 0x0, 0x0)
        /go/src/github.com/docker/docker/cli/cobraadaptor/adaptor.go:129 +0x93
github.com/docker/docker/cli.(*Cli).Run(0xc0822f2e40, 0xc082003f30, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/docker/docker/cli/cli.go:81 +0x352
main.main()
        /go/src/github.com/docker/docker/cmd/docker/docker.go:72 +0x4b1

BUG REPORT INFORMATION

Output of docker version:

Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.6.3
 Git commit:   919257d
 Built:        Wed Aug  3 09:51:21 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.6.3
 Git commit:   919257d
 Built:        Wed Aug  3 09:51:21 2016
 OS/Arch:      windows/amd64

Output of docker info:

Containers: 15
 Running: 3
 Paused: 0
 Stopped: 12
Images: 13
Server Version: 1.13.0-dev
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: nat null overlay
Swarm: inactive
Security Options:
Kernel Version: 10.0 14300 (14300.1045.amd64fre.rs1_release_svc.160705-1059)
Operating System: Windows Server 2016 Datacenter Technical Preview 5
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 28 GiB
Name: ACHEU001
ID: HS6A:DEGI:TTDB:YSUP:UZBP:DEXN:ILXE:BSHT:QYF3:WKAH:WIME:JMBW
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): true
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 53
 System Time: 2016-08-05T14:17:06.1810283Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
Azure Windows Server TP5

Steps to reproduce the issue:

  1. Create a folder c:\test with Dockerfile:
FROM windowsservercore
ENV DOCKER_HOST "tcp://DOCKERD_IP_ADDRESS:2375"
ADD docker.exe c:/Windows/System32/docker.exe
ENTRYPOINT powershell
  1. Build the image with cd c:\test; docker build -t docker .
  2. Run the container with docker run -v c:\test:c:\test:rw -it docker
  3. Run cd c:\test; docker build .

Describe the results you received:

panic()

Describe the results you expected:

new image

@thaJeztah thaJeztah added platform/windows kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. labels Aug 5, 2016
@thaJeztah
Copy link
Member

ping @jstarks @darrenstahlmsft ptal, looks like something in the client trying to resolve the path of the Dockerfile

@lowenna lowenna self-assigned this Feb 11, 2017
@lowenna
Copy link
Member

lowenna commented Mar 10, 2017

This is another instance of golang/go#15978. It should be fixed (not verified) when docker/docker moves to golang 1.8

@lowenna lowenna closed this as completed Mar 10, 2017
@vdemeester
Copy link
Member

We should close this only when we switch to go 1.8 and make sure it's fixed 👼 🙏. I am re-opening

@thaJeztah
Copy link
Member

Linking to #29030

@StefanScherer
Copy link
Contributor

Working in Windows containers inside a volume mountpoint you probably need Go 1.9 golang/go#18555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. platform/windows version/master
Projects
None yet
Development

No branches or pull requests

6 participants