Closed haohao1218 closed 2 years ago
Hi, When I ran docker-compose up, kit is crashed. The output shows as below. Any idea about this issue?
Building hello [+] Building 3.0s (10/12) => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 345B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/golang:latest 2.7s => [internal] load build context 0.0s => => transferring context: 1.65kB 0.0s => [1/8] FROM docker.io/library/golang@sha256:1860373709cc04bacfcf3bb1aaa8c14bb1243 0.0s => CACHED [2/8] RUN mkdir -p /go/src/gokit 0.0s => CACHED [3/8] WORKDIR /go/src/gokit 0.0s => [4/8] ADD . /go/src/gokit 0.0s => [5/8] WORKDIR /go/src/gokit 0.0s => ERROR [6/8] RUN go get -t -v ./... 0.2s
[6/8] RUN go get -t -v ./...: 10 0.192 go: go.mod file not found in current directory or any parent directory. 10 0.192 'go get' is no longer supported outside a module. 10 0.192 To build and install a command, use 'go install' with a version, 10 0.192 like 'go install example.com/cmd@latest' 10 0.192 For more information, see https://golang.org/doc/go-get-install-deprecation 10 0.192 or run 'go help get' or 'go help install'. executor failed running [/bin/sh -c go get -t -v ./...]: exit code: 1 ERROR: Service 'hello' failed to build : Build failed
[6/8] RUN go get -t -v ./...:
executor failed running [/bin/sh -c go get -t -v ./...]: exit code: 1 ERROR: Service 'hello' failed to build : Build failed
temporary solutions : try adding WORKDIR after line ADD in dockerfile
ADD . { FULL PATH TO PROJECT } WORKDIR { FULL PATH TO SERVICE }
Got it. It works for me. Thanks a lot!
Hi, When I ran docker-compose up, kit is crashed. The output shows as below. Any idea about this issue?
Building hello [+] Building 3.0s (10/12)
=> [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 345B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/golang:latest 2.7s => [internal] load build context 0.0s => => transferring context: 1.65kB 0.0s => [1/8] FROM docker.io/library/golang@sha256:1860373709cc04bacfcf3bb1aaa8c14bb1243 0.0s => CACHED [2/8] RUN mkdir -p /go/src/gokit 0.0s => CACHED [3/8] WORKDIR /go/src/gokit 0.0s => [4/8] ADD . /go/src/gokit 0.0s => [5/8] WORKDIR /go/src/gokit 0.0s => ERROR [6/8] RUN go get -t -v ./... 0.2s