-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 853 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# FROM golang:latest as build-arm
# RUN mkdir /app
# WORKDIR /app
# COPY ./ .
# RUN GOOS=linux GOARCH=arm go build -a -installsuffix cgo -ldflags="-w -s" -o discovery-engine
# FROM golang:latest as build-arm64
# RUN mkdir /app
# WORKDIR /app
# COPY ./ .
# RUN GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo -ldflags="-w -s" -o discovery-engine
FROM golang:latest as build
RUN mkdir /app
WORKDIR /app
COPY ./ .
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o discovery-engine
#FROM scratch as arm
#COPY --from=build-arm /app/discovery-engine /go/bin/discovery-engine
#ENTRYPOINT [ "/go/bin/discovery-engine" ]
#FROM scratch as arm64
#COPY --from=build-arm64 /app/discovery-engine /go/bin/discovery-engine
#ENTRYPOINT ["/go/bin/discovery-engine"]
FROM alpine:latest
COPY --from=build /app/discovery-engine /
ENTRYPOINT ["/discovery-engine"]