-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.trustee-gateway
More file actions
43 lines (26 loc) · 1.08 KB
/
Dockerfile.trustee-gateway
File metadata and controls
43 lines (26 loc) · 1.08 KB
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
37
38
39
40
41
42
43
ARG BASE_IMAGE=registry.openanolis.cn/openanolis/anolisos:23.3
FROM ${BASE_IMAGE} AS builder
ARG ALL_PROXY
ARG NO_PROXY
ENV ALL_PROXY=$ALL_PROXY
ENV NO_PROXY=$NO_PROXY
WORKDIR /usr/src/trustee
COPY . .
RUN yum install -y wget ca-certificates gcc
RUN wget https://mirrors.aliyun.com/golang/go1.21.6.linux-amd64.tar.gz && \
sha256sum go1.21.6.linux-amd64.tar.gz > go1.21.6.linux-amd64.tar.gz.sha256 && \
sha256sum -c go1.21.6.linux-amd64.tar.gz.sha256 && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
RUN go env -w GOPROXY=https://mirrors.aliyun.com/goproxy
RUN cd trustee-gateway && CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -ldflags="-s -w" -o gateway cmd/server/main.go
FROM ${BASE_IMAGE}
RUN yum install -y ca-certificates tzdata sqlite-libs
WORKDIR /app
COPY --from=builder /usr/src/trustee/trustee-gateway/gateway /app/
COPY --from=builder /usr/src/trustee/trustee-gateway/config.yaml /app/
VOLUME /app/data
EXPOSE 8081
ENV GIN_MODE=release
CMD ["./gateway", "--config", "/app/config.yaml"]