This repository has been archived by the owner on Nov 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
87 lines (68 loc) · 3 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
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
FROM centos:7
RUN mkdir /out
# helmfile
ENV HELMFILE_VERSION 0.114.0
RUN curl -LO https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64 && \
mv helmfile_linux_amd64 /out/helmfile && \
chmod +x /out/helmfile
# kubectl
ENV KUBECTL_VERSION 1.16.0
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
mv kubectl /out/kubectl && \
chmod +x /out/kubectl
# helm 3
ENV HELM3_VERSION 3.2.0
RUN curl -f -L https://get.helm.sh/helm-v${HELM3_VERSION}-linux-386.tar.gz | tar xzv && \
mv linux-386/helm /usr/local/bin/helm && \
mkdir -p $HOME/.jx/plugins/bin && \
ln -s /usr/local/bin/helm $HOME/.jx/plugins/bin/helm-${HELM3_VERSION}
# git
ENV GIT_VERSION 2.21.1
RUN yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel && \
yum install -y gcc perl-ExtUtils-MakeMaker make
RUN cd /usr/src && \
curl -LO https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
tar xzf git-${GIT_VERSION}.tar.gz && \
cd git-${GIT_VERSION} && \
make prefix=/usr/local/git all && \
make prefix=/usr/local/git install
# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
# Installing the package
RUN mkdir -p /usr/local/gcloud \
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
&& /usr/local/gcloud/google-cloud-sdk/install.sh && \
/usr/local/gcloud/google-cloud-sdk/bin/gcloud components install beta && \
/usr/local/gcloud/google-cloud-sdk/bin/gcloud components update
FROM golang:1.12.17
RUN mkdir /out
RUN mkdir -p /go/src/github.com/jenkins-x-labs
WORKDIR /go/src/github.com/jenkins-x-labs
RUN git clone https://github.com/jenkins-x/bdd-jx.git && \
cd bdd-jx && \
make testbin && \
mv build/bddjx /out/bddjx
RUN git clone https://github.com/jenkins-x/jx.git && \
cd jx && \
git checkout multicluster && \
make linux && \
mv build/linux/jx /out/jx
# Adding the package path to local
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
# use a multi stage image so we don't include all the build tools above
FROM centos:7
# need to copy the whole git source else it doesn't clone the helm plugin repos below
COPY --from=0 /usr/local/git /usr/local/git
COPY --from=0 /usr/bin/make /usr/bin/make
COPY --from=0 /out /usr/local/bin
COPY --from=1 /out /usr/local/bin
COPY --from=0 /usr/local/gcloud /usr/local/gcloud
ENV PATH /usr/local/bin:/usr/local/git/bin:$PATH:/usr/local/gcloud/google-cloud-sdk/bin
ENV HELM_PLUGINS /root/.cache/helm/plugins/
ENV JX_HELM3 "true"
ENV DIFF_VERSION 3.1.1
RUN helm plugin install https://github.com/databus23/helm-diff --version ${DIFF_VERSION} && \
helm plugin install https://github.com/aslafy-z/helm-git.git
# hack copying in a custom built bdd-jx and a custom jx from this PR as needed but not merged yet https://github.com/jenkins-x/jx/pull/6664
# COPY build/jx /usr/local/bin/jx
# COPY build/bddjx-linux /usr/local/bin/bddjx