-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
19 lines (15 loc) · 594 Bytes
/
Dockerfile
File metadata and controls
19 lines (15 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM golang:1.19 AS builder
ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64 \
GIT_TERMINAL_PROMPT=1
COPY ./main.go ${GOPATH}/src/github.com/kvendingoldo/echo-http-server/main.go
COPY ./go.mod ${GOPATH}/src/github.com/kvendingoldo/echo-http-server/go.mod
COPY ./go.sum ${GOPATH}/src/github.com/kvendingoldo/echo-http-server/go.sum
WORKDIR ${GOPATH}/src/github.com/kvendingoldo/echo-http-server
RUN go build -ldflags="-s -w" -o server .
FROM scratch
COPY --from=builder go/src/github.com/kvendingoldo/echo-http-server/server /app/
WORKDIR /app
EXPOSE 8080
ENTRYPOINT ["/app/server"]