build: 优化 dockerfile
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/.idea
|
||||
@@ -4,6 +4,10 @@ RUN go env -w CGO_ENABLED=0
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -ldflags '-extldflags "-static" -s -w' -o runner ./cmd/bitsrun
|
||||
|
||||
Reference in New Issue
Block a user