-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
36 lines (27 loc) · 970 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
32
33
34
35
36
FROM golang:1.20-alpine as builder
WORKDIR /build
ADD . /go/src/github.com/octu0/example-xds-server
RUN set -eux && \
apk add --no-cache --virtual .build-deps git make openssh-client && \
cd /go/src/github.com/octu0/example-xds-server && \
GOOS=linux GOARCH=amd64 go build -a \
-tags netgo -installsuffix netgo --ldflags '-extldflags "-static"' \
-o /build/example-xds-server \
cmd/main.go \
&& \
/build/example-xds-server --version && \
apk del .build-deps
# ----------------------------------
FROM alpine:3.18
RUN apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
WORKDIR /app
COPY --from=builder /build/ /app/
RUN set -eux && \
apk add --no-cache ca-certificates curl dumb-init openssl && \
/app/example-xds-server --version
EXPOSE 8000
EXPOSE 8001
VOLUME [ "/app" ]
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [ "docker-entrypoint.sh" ]