BulletJournal icon indicating copy to clipboard operation
BulletJournal copied to clipboard

auth-proxy build issue

Open Zhaoyu-W opened this issue 3 years ago • 0 comments

Initially I ranbuildImage.sh on my local machine, it showed the following errors

[+] Building 4.2s (16/18)
 => [internal] load build definition from Dockerfile                                                                                               0.0s
 => => transferring dockerfile: 386B                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                   3.0s
 => [internal] load metadata for docker.io/library/golang:alpine                                                                                   3.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                      0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                      0.0s
 => [builder 1/6] FROM docker.io/library/golang:alpine@sha256:42d35674864fbb577594b60b84ddfba1be52b4d4298c961b46ba95e9fb4712e8                     0.0s
 => [stage-1 1/5] FROM docker.io/library/alpine:latest@sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454                     0.0s
 => [internal] load build context                                                                                                                  0.5s
 => => transferring context: 26.29kB                                                                                                               0.5s
 => CACHED [stage-1 2/5] COPY localhost.cert /bin/                                                                                                 0.0s
 => CACHED [stage-1 3/5] COPY localhost.key /bin/                                                                                                  0.0s
 => CACHED [builder 2/6] RUN apk add git                                                                                                           0.0s
 => CACHED [builder 3/6] WORKDIR /go/src/github.com/discourse/discourse-auth-proxy                                                                 0.0s
 => CACHED [builder 4/6] COPY internal ./internal/                                                                                                 0.0s
 => CACHED [builder 5/6] COPY *.go ./                                                                                                              0.0s
 => ERROR [builder 6/6] RUN go get && go build                                                                                                     0.5s
------
 > [builder 6/6] RUN go get && go build:
#16 0.446 go: go.mod file not found in current directory or any parent directory.
#16 0.446       'go get' is no longer supported outside a module.
#16 0.446       To build and install a command, use 'go install' with a version,
#16 0.446       like 'go install example.com/cmd@latest'
#16 0.446 	For more information, see https://golang.org/doc/go-get-install-deprecation
#16 0.446 	or run 'go help get' or 'go help install'.
------
executor failed running [/bin/sh -c go get && go build]: exit code: 1

After added RUN go env -w GO111MODULE=off before RUN go get && go build in auth-proxy/Dockfile, it works.

Reference: Error message "go: go.mod file not found in current directory or any parent directory; see 'go help modules'"

Zhaoyu-W avatar Apr 17 '22 13:04 Zhaoyu-W