-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.job
29 lines (23 loc) · 959 Bytes
/
Dockerfile.job
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
# Build the manager binary
FROM golang:1.18 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod bytetrade.io/web3os/app-service/go.mod
COPY go.sum bytetrade.io/web3os/app-service/go.sum
# Copy the go source
COPY cmd/ bytetrade.io/web3os/app-service/cmd/
COPY api/ bytetrade.io/web3os/app-service/api/
COPY controllers/ bytetrade.io/web3os/app-service/controllers/
COPY pkg/ bytetrade.io/web3os/app-service/pkg/
# Build
RUN cd bytetrade.io/web3os/app-service && \
go mod tidy
RUN cd bytetrade.io/web3os/app-service && \
CGO_ENABLED=0 go build -a -o upgrade-job cmd/upgrade-job/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:nonroot
FROM dtzar/helm-kubectl:3.7.1
WORKDIR /
COPY --from=builder /workspace/bytetrade.io/web3os/app-service/upgrade-job .
ENTRYPOINT ["/upgrade-job"]