-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
24 lines (18 loc) · 946 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
FROM golang:1.18.2-alpine as builder
RUN apk add --no-cache git curl openssl
RUN mkdir -p /workspace/openpitrix-jobs/
WORKDIR /workspace/openpitrix-jobs/
COPY . .
RUN mkdir -p /release_bin
#RUN cd cmd/dump-all/ && CGO_ENABLED=0 GOBIN=/release_bin go install -mod=vendor -ldflags '-w -s' kubesphere.io/openpitrix-jobs/cmd/dump-all/...
RUN CGO_ENABLED=0 GOBIN=/release_bin go install -mod=vendor -ldflags '-w -s' kubesphere.io/openpitrix-jobs/cmd/import-app/...
#RUN CGO_ENABLED=0 GOBIN=/release_bin go install -mod=vendor -ldflags '-w -s' kubesphere.io/openpitrix-jobs/cmd/upgrade/...
FROM alpine:3.16.0
WORKDIR /root
COPY import-config.yaml kubesphere/
COPY --from=builder /release_bin/* /usr/local/bin/
# Disable cache, always download chart package
ARG BUILDDATE
RUN echo "$BUILDDATE"
COPY urls.txt /root
RUN mkdir -p package && cp urls.txt package && cd /root/package && for pkg in $(cat urls.txt); do wget $pkg; done && rm urls.txt