-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (25 loc) · 1.12 KB
/
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
# Build the manager binary
FROM golang:1.18 as builder
WORKDIR /workspace
RUN git clone https://github.com/kubernetes/code-generator.git bytetrade.io/web3os/code-generator && \
cd bytetrade.io/web3os/code-generator && git checkout -b release-1.27 && cd -
# Copy the Go Modules manifests
COPY go.mod bytetrade.io/web3os/system-server/go.mod
COPY go.sum bytetrade.io/web3os/system-server/go.sum
# Build
RUN cd bytetrade.io/web3os/system-server && \
go mod download
# Copy the go source
COPY cmd/ bytetrade.io/web3os/system-server/cmd/
COPY pkg/ bytetrade.io/web3os/system-server/pkg/
COPY hack/ bytetrade.io/web3os/system-server/hack/
RUN cd bytetrade.io/web3os/system-server && \
CGO_ENABLED=1 go build -ldflags="-s -w" -a -o system-server cmd/server/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# FROM gcr.io/distroless/base:nonroot
FROM gcr.io/distroless/base:debug
WORKDIR /
COPY --from=builder /workspace/bytetrade.io/web3os/system-server/system-server .
VOLUME [ "/data" ]
ENTRYPOINT ["/system-server"]