forked from gardener/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
150 lines (122 loc) · 4.41 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
############# builder #############
FROM golang:1.17 AS builder
WORKDIR /go/src/github.com/gardener/test-infra
COPY . .
RUN make install
############# tm-controller #############
FROM alpine:3.16 AS tm-controller
COPY charts /charts
COPY --from=builder /go/bin/testmachinery-controller /testmachinery-controller
WORKDIR /
ENTRYPOINT ["/testmachinery-controller"]
############# telemetry-controller #############
FROM alpine:3.16 AS telemetry-controller
RUN apk add --update bash curl
COPY --from=builder /go/bin/telemetry-controller /telemetry-controller
COPY ./.env /
WORKDIR /
ENTRYPOINT ["/telemetry-controller"]
############# tm-base-step #############
FROM golang:1.17-alpine3.16 AS base-step
ENV HELM_TILLER_VERSION=v2.13.0
ENV KUBECTL_VERSION=v1.19.7
ENV HELM_V3_VERSION=v3.1.1
RUN \
apk update \
&& apk add \
apache2-utils \
coreutils \
cargo \
bash \
binutils \
bind-tools \
build-base \
curl \
file \
gcc \
git \
jq \
libc-dev \
libev-dev \
libffi-dev \
openssh \
openssl \
openssl-dev \
python3 \
python3-dev \
py3-pip \
wget \
grep \
findutils \
rsync \
bc \
linux-headers \
# need to install the specific google-crc32c version as newer version failed to install due to missing "crc32c/crc32c.h"
# see https://github.com/googleapis/python-crc32c/issues/83
&& pip install google-crc32c==1.1.2 \
&& pip install --upgrade pip \
"gardener-cicd-cli>=1.1437.0" \
"gardener-cicd-libs>=1.1437.0" \
awscli \
&& mkdir -p /cc/utils && ln -s /usr/bin/cli.py /cc/utils/cli.py \
&& curl -Lo /bin/kubectl \
https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl \
&& chmod +x /bin/kubectl \
&& curl -L \
https://get.helm.sh/helm-${HELM_TILLER_VERSION}-linux-amd64.tar.gz \
| tar xz -C /bin --strip=1 \
&& chmod +x /bin/helm \
&& curl -L \
https://get.helm.sh/helm-${HELM_V3_VERSION}-linux-amd64.tar.gz | tar xz -C /tmp --strip=1 \
&& mv /tmp/helm /bin/helm3 \
&& curl -Lo /bin/yaml2json \
https://github.com/bronze1man/yaml2json/releases/download/v1.2/yaml2json_linux_amd64 \
&& chmod +x /bin/yaml2json \
&& curl -Lo /bin/cfssl \
https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 \
&& chmod +x /bin/cfssl \
&& curl -Lo /bin/cfssljson \
https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 \
&& chmod +x /bin/cfssljson \
&& curl http://aia.pki.co.sap.com/aia/SAP%20Global%20Root%20CA.crt -o \
/usr/local/share/ca-certificates/SAP_Global_Root_CA.crt \
&& curl http://aia.pki.co.sap.com/aia/SAPNetCA_G2.crt -o \
/usr/local/share/ca-certificates/SAPNetCA_G2.crt \
&& curl http://aia.pki.co.sap.com/aia/SAP%20Global%20Sub%20CA%2002.crt -o \
/usr/local/share/ca-certificates/SAP_Global_Sub_CA_02.crt \
&& curl http://aia.pki.co.sap.com/aia/SAP%20Global%20Sub%20CA%2004.crt -o \
/usr/local/share/ca-certificates/SAP_Global_Sub_CA_04.crt \
&& curl http://aia.pki.co.sap.com/aia/SAP%20Global%20Sub%20CA%2005.crt -o \
/usr/local/share/ca-certificates/SAP_Global_Sub_CA_05.crt \
&& update-ca-certificates
ENV PATH /cc/utils/bin:$PATH
############# tm-run #############
FROM base-step AS tm-run
COPY --from=builder /go/bin/testrunner /testrunner
WORKDIR /
ENTRYPOINT ["/testrunner"]
############# tm-bot #############
FROM alpine:3.16 AS tm-bot
RUN apk add --update bash curl
COPY ./pkg/tm-bot/ui/static /app/static
COPY ./pkg/tm-bot/ui/templates /app/templates
COPY --from=builder /go/bin/tm-bot /tm-bot
WORKDIR /
ENTRYPOINT ["/tm-bot"]
############# tm-prepare #############
FROM base-step AS tm-prepare
COPY --from=builder /go/bin/prepare /tm/prepare
CMD [ "/tm/prepare" ]