forked from kubeflow/arena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
89 lines (63 loc) · 2.34 KB
/
Dockerfile.build
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#**********************************************************************
# Builder
#
# Create a go runtime for building arena
ARG GOLANG_VERSION=1.14
ARG KUBE_VERSION=v1.13.6
ARG HELM_VERSION=v2.14.1
ARG VERSION=v0.3.0-rc
ARG OS_ARCH=linux-amd64
ARG COMMIT=stable
ARG TARGET=cli-$OS_ARCH
FROM golang:$GOLANG_VERSION-stretch as build
ARG KUBE_VERSION
ARG HELM_VERSION
ARG OS_ARCH
ARG TARGET
ENV KUBE_VERSION $KUBE_VERSION
ENV HELM_VERSION $HELM_VERSION
ENV VERSION $VERSION
ENV OS_ARCH $OS_ARCH
ENV COMMIT $COMMIT
ENV TARGET $TARGET
ENV GO111MODULE off
RUN mkdir -p /go/src/github.com/kubeflow/arena
WORKDIR /go/src/github.com/kubeflow/arena
COPY . .
RUN make $TARGET
RUN wget http://kubeflow-hk.oss-cn-hongkong.aliyuncs.com/helm-$HELM_VERSION-$OS_ARCH.tar.gz && \
tar -xvf helm-$HELM_VERSION-$OS_ARCH.tar.gz && \
mv $OS_ARCH/helm /usr/local/bin/helm && \
chmod u+x /usr/local/bin/helm && \
chmod u+x /go/src/github.com/kubeflow/arena/install.sh
RUN OS=$(echo $OS_ARCH | cut -f1 -d-) && \
ARCH=$(echo $OS_ARCH | cut -f2 -d-) && \
curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/${OS}/${ARCH}/kubectl && \
chmod +x /usr/local/bin/kubectl
#**********************************************************************
#
# Create arena pacakge
#
FROM centos:7
ARG KUBE_VERSION
ARG HELM_VERSION
ARG OS_ARCH
ARG TARGET
ARG COMMIT
ARG VERSION
ENV OS_ARCH $OS_ARCH
ENV COMMIT $COMMIT
ENV TARGET $TARGET
ENV VERSION $VERSION
ENV ARENA_HOME /arena-installer
ENV ARENA_TARFILE /arena-installer-$VERSION-$COMMIT-$OS_ARCH.tar.gz
RUN mkdir -p $ARENA_HOME/bin
COPY --from=build /go/src/github.com/kubeflow/arena/bin/arena $ARENA_HOME/bin/arena
COPY --from=build /go/src/github.com/kubeflow/arena/bin/arena-uninstall $ARENA_HOME/bin/arena-uninstall
COPY --from=build /go/src/github.com/kubeflow/arena/install.sh $ARENA_HOME/install.sh
COPY --from=build /go/src/github.com/kubeflow/arena/arena-gen-kubeconfig.sh $ARENA_HOME/bin/arena-gen-kubeconfig.sh
COPY --from=build /usr/local/bin/helm $ARENA_HOME/bin/helm
COPY --from=build /go/src/github.com/kubeflow/arena/kubernetes-artifacts $ARENA_HOME/kubernetes-artifacts
COPY --from=build /usr/local/bin/kubectl $ARENA_HOME/bin/kubectl
COPY --from=build /go/src/github.com/kubeflow/arena/charts $ARENA_HOME/charts
RUN tar -zcvf $ARENA_TARFILE $ARENA_HOME