mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-30 08:06:40 +02:00
Optimize Dockerfile generated by Gomu (#2253)
This change prevents having to rebuild the entire Docker image when your source code changes.
This commit is contained in:
parent
a36f52c6d2
commit
0dd6afe128
@ -5,8 +5,10 @@ var Dockerfile = `FROM golang:alpine AS builder
|
||||
ENV CGO_ENABLED=0 GOOS=linux
|
||||
WORKDIR /go/src/{{.Alias}}
|
||||
RUN apk --update --no-cache add ca-certificates gcc libtool make musl-dev protoc
|
||||
COPY . /go/src/{{.Alias}}
|
||||
RUN make {{if not .Client}}init proto {{end}}tidy build
|
||||
COPY {{if not .Client}}Makefile {{end}go.mod go.sum ./
|
||||
RUN {{if not .Client}}make init && {{end}}go mod download
|
||||
COPY . .
|
||||
RUN make {{if not .Client}}proto {{end}}tidy build
|
||||
|
||||
FROM scratch
|
||||
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
|
||||
|
Loading…
Reference in New Issue
Block a user