1

Forgive me if this is a duplicate as I have not encountered a similar issue on stackoverflow before. Kindly provide the link if you have one.

The issue:

I have downloaded several Windows Golang images from docker hub and I have tried installing (go get) packages from inside the container. This fails with the following error (happens for all the various images I have tried).

enter image description here

I have even tried using a pure windowsservercore image, where I installed Golang and Git before running the go get command.

I’m not entirely sure what the issue could be but I believe status 66 has something to do with data race ? how do I fix this ?

Reproducing:

Step 1:

Docker pull golang:1.11.1-windowsservercore-1709  

Step 2:

Docker run -it --rm golang:1.11.1-windowsservercore-1709 powershell

Step 3:

PS C:\gopath> go get -d github.com/gorilla/mux

Screenshot of a failed docker build. enter image description here

5
  • I ran : docker run --pull -it --rm golang:1.11.1-windowsservercore-1709 Then when in the container i checked that the go environment variable was there and checked that git was installed. Finally ran the go get github.com/gorilla/mux and all was cloned fine.
    – leeroya
    Nov 26, 2018 at 11:04
  • Hey @leeroya thanks for the quick response. I have tried your suggestion but somehow it does not work on my machine. Please see the image attached.
    – Godfrey
    Nov 26, 2018 at 17:19
  • I managed to have a look at this, so it turns out that you do not have PowerShell available to you in this image. Not all windows images come with Powershell only CMD, so change the Dockerfile to call the CMD like this: RUN ["CMD", "-c", "go get -d github.com/gorilla/mux"]
    – leeroya
    Jan 10, 2019 at 11:23
  • I ran into the same issue (though with a different go package). Although certainly, powershell is available on my docker, the tip which @leeroya gave directed me to a good workaround. Changing: RUN powershell go get github.com/... to RUN cmd go get github.com/... solved it. Apparently it is powershell in the container which affects 'go get' somehow.
    – zuraff
    Apr 23, 2019 at 13:36
  • Honestly it worked for me too. @Leeroya please put your response in the answer section so I can mark it as the correct answer.
    – Godfrey
    Apr 24, 2019 at 15:52

1 Answer 1

1

I managed to have a look at this, so it turns out that you do not have PowerShell available to you in this image.

Not all windows images come with Powershell only CMD, so change the Dockerfile to call the CMD like this:

enter code hereRUN ["CMD", "-c", "go get -d github.com/gorilla/mux"]

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.