kit icon indicating copy to clipboard operation
kit copied to clipboard

Docker compose up crashes on go get command

Open fabulousduck opened this issue 5 years ago • 5 comments

when using the generated docker compose file by calling sudo docker-compose up. It fails with the following error:

ERROR: Service 'bugs' failed to build: The command '/bin/sh -c go get -t -v ./...' returned a non-zero code: 1

Looking at the logs it outputs, it seems like a lot of packages are not being installed. Trying to execute go get -t -v ./... locally in the root folder of the project works just fine.

fabulousduck avatar Nov 14 '18 21:11 fabulousduck

I have this issue as well, anyone has solution yet?

Thanks

tunght avatar Dec 04 '18 22:12 tunght

Hi @fabulousduck @tunght ,

I had the same problem and I fixed it adding the workspace in the Dockerfile. So for example if my Dockerfile was:

FROM golang

RUN mkdir -p /go/src/github.com/gonzalobf/go-kit-example

ADD . /go/src/github.com/gonzalobf/example

RUN go get  -t -v ./...
...

I added the workdir to the service, in this case custom-auth

FROM golang

RUN mkdir -p /go/src/github.com/gonzalobf/go-kit-example

WORKDIR /go/src/github.com/gonzalobf/go-kit-example/custom-auth

ADD . /go/src/github.com/gonzalobf/go-kit-example

RUN go get  -t -v ./...

Let me know if you have any further problem.

gonzalobf avatar Dec 24 '18 13:12 gonzalobf

I think appdash "sourcegraph.com/sourcegraph/appdash" and opentracing "sourcegraph.com/github.com/sourcegraph/appdash/opentracing" are the problems, it can't be downloaded or something, the link is dead I guess.

ridwankustanto avatar Jan 21 '19 07:01 ridwankustanto

Is there any solution for this and how to stop go-kit files download always when i hit docker-compose up

porika-v avatar Jan 24 '19 05:01 porika-v

This probably has nothing to do with it but I increased the watchers on my machine and added the WORKDIR and after doing both it's working now... weird.. Just adding the WORKDIR by itself didn't solve it for me...

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

happilymarrieddad avatar May 29 '19 20:05 happilymarrieddad