docker golang build cache
This commit is contained in:
parent
0f7238c6a8
commit
08a36d8165
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ WORKDIR /app
|
|||
|
||||
COPY go.mod ./
|
||||
COPY go.sum ./
|
||||
RUN go mod download
|
||||
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod go mod download all
|
||||
|
||||
COPY ./pkg ./pkg
|
||||
COPY ./src ./src
|
||||
|
@ -14,7 +14,7 @@ COPY ./templates ./templates
|
|||
COPY embed.go embed.go
|
||||
|
||||
RUN go generate ./...
|
||||
RUN CGO_ENABLED=0 go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
|
||||
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
|
||||
|
||||
|
||||
FROM scratch
|
||||
|
|
Loading…
Reference in a new issue