-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.e2e
55 lines (44 loc) · 1.9 KB
/
Dockerfile.e2e
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
FROM ubuntu:latest
RUN mkdir -p /src
WORKDIR /src
# Install dependencies
RUN apt-get update -y && \
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common wget jq gettext-base
# Install yq
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && \
chmod +x /usr/bin/yq
# Install Go 1.22.1
RUN wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz && \
tar -xf go1.22.1.linux-amd64.tar.gz && \
mv go /usr/local/
ENV GOROOT=/usr/local/go
ENV GOPATH=/root/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
# Install KinD
RUN go install sigs.k8s.io/[email protected]
# Install Docker client
RUN curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" && \
apt-get update && \
apt-get install -y docker-ce && \
rm -rf /var/lib/apt/lists/*
# Install kubectl CLI
ARG KUBECTL_VERSION
RUN curl -LO https://dl.k8s.io/release/v"${KUBECTL_VERSION:-1.21.3}"/bin/linux/amd64/kubectl && \
mv kubectl /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl
# Install Helm CLI
ARG HELM_CLI_VERSION
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \
chmod 700 get_helm.sh && \
./get_helm.sh --no-sudo --version ${HELM_CLI_VERSION:-v3.5.2}
# Install Openshift CLI
ARG OC_CLI_VERSION
RUN curl -k -fsSL -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${OC_CLI_VERSION:-stable}/openshift-client-linux.tar.gz && \
tar -xzf oc.tar.gz && \
mv oc /usr/local/bin/ && \
rm -f oc.tar.gz kubectl README.md
# Add the WORKDIR as a safe directory so git commands
# can be run in containers using this image
RUN git config --global --add safe.directory /src
ENV CONTAINERIZED=true