-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile_test
37 lines (25 loc) · 1.08 KB
/
Dockerfile_test
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
FROM golang:1.17.7
RUN apt-get update && apt-get install -y git bzr ca-certificates curl gcc
WORKDIR /workspace
ENV GO111MODULE=on
ENV TEST_BINPATH=/binpath
# new envs for cert-manager
ENV TEST_ASSET_ETCD=/binpath/etcd
ENV TEST_ASSET_KUBE_APISERVER=/binpath/kube-apiserver
ENV TEST_ASSET_KUBECTL=/binpath/kubectl
RUN mkdir ${TEST_BINPATH}
ENV KUBERNETES 1.22.8
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES}/bin/linux/amd64/kubectl && \
chmod +x ./kubectl; \
mv ./kubectl ${TEST_BINPATH}
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES}/bin/linux/amd64/kube-apiserver && \
chmod +x ./kube-apiserver; \
mv ./kube-apiserver ${TEST_BINPATH}
ENV ETCD 3.3.15
RUN curl -LO https://github.com/etcd-io/etcd/releases/download/v${ETCD}/etcd-v${ETCD}-linux-amd64.tar.gz && \
tar -xvf etcd-v${ETCD}-linux-amd64.tar.gz && \
mv etcd-v${ETCD}-linux-amd64/etcd ${TEST_BINPATH} && \
rm -rf etcd-v${ETCD}-linux-amd64 && rm etcd-v${ETCD}-linux-amd64.tar.gz
COPY go.mod .
COPY go.sum .
RUN go mod download