-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.api
35 lines (24 loc) · 981 Bytes
/
Dockerfile.api
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
FROM golang:1.18 as builder
WORKDIR /workspace
ENV ksVersion=v3.3.0
# Copy the Go Modules manifests
COPY go.mod bytetrade.io/web3os/bfl/go.mod
COPY go.sum bytetrade.io/web3os/bfl/go.sum
RUN git clone https://github.com/beclab/kubesphere-ext.git bytetrade.io/kubesphere-ext && \
cd bytetrade.io/kubesphere-ext && \
git checkout -b $ksVersion
RUN cd bytetrade.io/web3os/bfl && \
go mod download
# Copy the go source
COPY cmd/ bytetrade.io/web3os/bfl/cmd/
COPY pkg/ bytetrade.io/web3os/bfl/pkg/
COPY internal/ bytetrade.io/web3os/bfl/internal/
RUN cd bytetrade.io/web3os/bfl/ && \
CGO_ENABLED=0 go build -ldflags="-s -w" -a -o bfl-api cmd/apiserver/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/static:debug
WORKDIR /
COPY --from=builder /workspace/bytetrade.io/web3os/bfl/bfl-api .
USER 65532:65532
ENTRYPOINT ["/bfl-api"]