Dockerfile: make image build from local source code instead of copying outside build.
This commit is contained in:
parent
c4d4734095
commit
05e995b11b
1 changed files with 11 additions and 2 deletions
13
Dockerfile
13
Dockerfile
|
@ -1,11 +1,20 @@
|
|||
FROM alpine:latest as certs
|
||||
RUN apk --update add ca-certificates
|
||||
|
||||
FROM golang:alpine as build
|
||||
WORKDIR /app/
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -v
|
||||
|
||||
FROM scratch
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=build /app/webdav /webdav
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY webdav /webdav
|
||||
|
||||
ENTRYPOINT [ "/webdav" ]
|
||||
|
|
Loading…
Add table
Reference in a new issue