WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Error using docker build in WSL 2

Open vadimdr opened this issue 7 years ago • 7 comments

  • Windows build number: Microsoft Windows [Version 10.0.18970.1001]

Getting the following error while running docker build command:

  • docker build --target npm_build --cache-from XXXXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com/XXXXXXXXXXX:builder -t XXXXXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com/XXXXXXXXXXXXXXX:builder -f ../Dockerfile ../. free(): invalid pointer SIGABRT: abort PC=0x7ff9cd534e97 m=0 sigcode=18446744073709551610 signal arrived during cgo execution

goroutine 1 [syscall, locked to thread]: runtime.cgocall(0x4afd50, 0xc420059cc0, 0xc420059ce8) /usr/lib/go-1.8/src/runtime/cgocall.go:131 +0xe2 fp=0xc420059c90 sp=0xc420059c50 github.com/docker/docker-credential-helpers/secretservice._Cfunc_free(0x1db6da0) github.com/docker/docker-credential-helpers/secretservice/_obj/_cgo_gotypes.go:111 +0x41 fp=0xc420059cc0 sp=0xc420059c90 github.com/docker/docker-credential-helpers/secretservice.Secretservice.List.func5(0x1db6da0) /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/obj-x86_64-linux-gnu/src/github.com/docker/docker-credential-helpers/secretservice/secretservice_linux.go:96 +0x60 fp=0xc420059cf8 sp=0xc420059cc0 github.com/docker/docker-credential-helpers/secretservice.Secretservice.List(0x0, 0x756060, 0xc420014370) /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/obj-x86_64-linux-gnu/src/github.com/docker/docker-credential-helpers/secretservice/secretservice_linux.go:97 +0x217 fp=0xc420059da0 sp=0xc420059cf8 github.com/docker/docker-credential-helpers/secretservice.(*Secretservice).List(0x77e548, 0xc420059e88, 0x410022, 0xc4200142d0) :4 +0x46 fp=0xc420059de0 sp=0xc420059da0 github.com/docker/docker-credential-helpers/credentials.List(0x756ba0, 0x77e548, 0x7560e0, 0xc42000e018, 0x0, 0x10) /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/obj-x86_64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:145 +0x3e fp=0xc420059e68 sp=0xc420059de0 github.com/docker/docker-credential-helpers/credentials.HandleCommand(0x756ba0, 0x77e548, 0x7fffdbf22b66, 0x4, 0x7560a0, 0xc42000e010, 0x7560e0, 0xc42000e018, 0x40e398, 0x4d35c0) /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/obj-x86_64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:60 +0x16d fp=0xc420059ed8 sp=0xc420059e68 github.com/docker/docker-credential-helpers/credentials.Serve(0x756ba0, 0x77e548) /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/obj-x86_64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:41 +0x1cb fp=0xc420059f58 sp=0xc420059ed8 main.main() /build/golang-github-docker-docker-credential-helpers-cMhSy1/golang-github-docker-docker-credential-helpers-0.5.0/secretservice/cmd/main_linux.go:9 +0x4f fp=0xc420059f88 sp=0xc420059f58 runtime.main() /usr/lib/go-1.8/src/runtime/proc.go:185 +0x20a fp=0xc420059fe0 sp=0xc420059f88 runtime.goexit() /usr/lib/go-1.8/src/runtime/asm_amd64.s:2197 +0x1 fp=0xc420059fe8 sp=0xc420059fe0

goroutine 17 [syscall, locked to thread]: runtime.goexit() /usr/lib/go-1.8/src/runtime/asm_amd64.s:2197 +0x1

rax 0x0 rbx 0x7fffdbf220b0 rcx 0x7ff9cd534e97 rdx 0x0 rdi 0x2 rsi 0x7fffdbf21e40 rbp 0x7fffdbf221b0 rsp 0x7fffdbf21e40 r8 0x0 r9 0x7fffdbf21e40 r10 0x8 r11 0x246 r12 0x7fffdbf220b0 r13 0x1000 r14 0x0 r15 0x30 rip 0x7ff9cd534e97 rflags 0x246 cs 0x33 fs 0x0 gs 0x0 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/build?buildargs=%7B%7D&cachefrom=%5B%22XXXXXXXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com%2Fidentityserver-build%3Abuilder%22%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=6vsvjt1blac86ym0wtlvz4qzb&shmsize=0&t=XXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com%2FXXXXXXXXXXXXXX%3Abuilder&target=npm_build&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied

Tried to remove and reinstall the docker package, same issue

Same command works fine from poweshell and works fine from my ubuntu machine as well

vadimdr avatar Sep 11 '19 18:09 vadimdr

same issue

davidwudv avatar Dec 12 '19 06:12 davidwudv

Hello. I am having the same issue. I have the repro steps here in my project: https://github.com/InsulinShock/HighLevelTarget/wiki It works the first time through and docker info can be called without sudo; but fails after a restarting the container, wsl -t Ubuntu-18.04. The change following the reboot is very perplexing.

InsulinShock avatar Jan 02 '20 14:01 InsulinShock

@InsulinShock thanks for your repro steps. But steps 10, 12, 13 are not needed. You do not have to expose TCP port 2375 in Docker Desktop and also do not need to install docker-ce in the distro manually. With Docker Desktop Edge you can enable the cli integration. Have a look in the Settings - Resources there should be an additional WSL settings ui to enable which distro should have the linux cli.

StefanScherer avatar Jan 04 '20 21:01 StefanScherer

@StefanScherer thank you for the insight. I had seen the CLI settings but had not tried them. I will try the workflow again and remove steps 10,12,13 to see if I can get the same result. Is there any information (i.e. docs) that you would recommend for setting up the daemon and client to use something other than the TCP 2375 port? Thanks again.

InsulinShock avatar Jan 07 '20 01:01 InsulinShock

@InsulinShock At the moment we have this chapter in our docs https://docs.docker.com/docker-for-windows/wsl-tech-preview/

StefanScherer avatar Jan 07 '20 08:01 StefanScherer

@StefanScherer The workflow presented in https://docs.docker.com/docker-for-windows/wsl-tech-preview/ is successful when the CLI features are enabled. docker info executes without sudo privileges enabled. I have seen several other s posts around dealing with the same issue, this solution might be very helpful for those users as well.

InsulinShock avatar Jan 08 '20 12:01 InsulinShock

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!