kit
kit copied to clipboard
Docker compose up crashes on go get command
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.
I have this issue as well, anyone has solution yet?
Thanks
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.
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.
Is there any solution for this and how to stop go-kit files download always when i hit docker-compose up
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