-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-env.Dockerfile
238 lines (221 loc) · 6.77 KB
/
make-env.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
ARG DOCKER_ARCH=x86_64
ARG GO_ARCH=$(shell go env GOARCH)
ARG GO_OS=$(shell go env GOOS)
ARG CHROME_IMAGE=docker.io/chromedp/headless-shell
ARG CHROME_VERSION=116.0.5845.14
ARG MAKE_ENV_BASE64=base64
ARG MAKE_ENV_CHMOD=chmod
ARG MAKE_ENV_CURL=curl
ARG MAKE_ENV_GO=go
ARG MAKE_ENV_LN=ln
ARG MAKE_ENV_MKDIR=mkdir
ARG MAKE_ENV_MV=mv
ARG MAKE_ENV_RM=rm
ARG MAKE_ENV_TAR=tar
ARG MAKE_ENV_TOUCH=touch
ARG MAKE_ENV_UNZIP=unzip
FROM docker.io/alpine/curl:8.8.0 AS make-env-docker
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG DOCKER_MIRROR=https://download.docker.com/linux/static/stable
ARG DOCKER_VERSION=27.1.0
ARG DOCKER_URL=${DOCKER_MIRROR}/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${DOCKER_URL} | tar -x -z -C /opt/make-env/download docker/docker \
&& ${MAKE_ENV_MV} /opt/make-env/download/docker/docker /opt/make-env/bin/docker \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/docker
FROM docker.io/alpine/curl:8.8.0 AS make-env-docker-buildx
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG DOCKER_BUILDX_MIRROR=https://github.com/docker/buildx/releases/download
ARG DOCKER_BUILDX_VERSION=v0.16.1
ARG DOCKER_BUILDX_URL=${DOCKER_BUILDX_MIRROR}/${DOCKER_BUILDX_VERSION}/buildx-${DOCKER_BUILDX_VERSION}.${GO_OS}-${GO_ARCH}
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${DOCKER_BUILDX_URL} -o /opt/make-env/bin/docker-buildx \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/docker-buildx
FROM docker.io/library/golang:1.19 AS make-env-ginkgo
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG GINKGO_VERSION=$(shell go mod edit -print | grep ginkgo | cut -d ' ' -f2)
RUN GOBIN=/opt/make-env/bin \
${MAKE_ENV_GO} install \
github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}
FROM docker.io/alpine/curl:8.8.0 AS make-env-helm
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG HELM_MIRROR=https://dl.k8s.io/release
ARG HELM_VERSION=v3.12.2
ARG HELM_URL=https://get.helm.sh/helm-${HELM_VERSION}-${GO_OS}-${GO_ARCH}.tar.gz
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${HELM_URL} | tar -x -z -C /opt/make-env/download ${GO_OS}-${GO_ARCH}/helm \
&& ${MAKE_ENV_MV} /opt/make-env/download/${GO_OS}-${GO_ARCH}/helm /opt/make-env/bin/helm \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/helm
FROM docker.io/library/golang:1.19 AS make-env-helm-hog
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
RUN GOBIN=/opt/make-env/bin \
${MAKE_ENV_GO} install \
github.com/meln5674/helm-hog@3af9ec621dcc359e38e966a255571a39beefe624
FROM docker.io/alpine/curl:8.8.0 AS make-env-kind
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG KIND_MIRROR=https://github.com/kubernetes-sigs/kind/releases/download
ARG KIND_VERSION=v0.17.0
ARG KIND_URL=${KIND_MIRROR}/${KIND_VERSION}/kind-${GO_OS}-${GO_ARCH}
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${KIND_URL} -o /opt/make-env/bin/kind \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/kind
FROM docker.io/alpine/curl:8.8.0 AS make-env-kubectl
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG KUBECTL_MIRROR=https://dl.k8s.io/release
ARG KUBECTL_VERSION=v1.25.11
ARG KUBECTL_URL=${KUBECTL_MIRROR}/${KUBECTL_VERSION}/bin/${GO_OS}/${GO_ARCH}/kubectl
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${KUBECTL_URL} -o /opt/make-env/bin/kubectl \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/kubectl
FROM docker.io/alpine/curl:8.8.0 AS make-env-yq
ARG MAKE_ENV_BASE64
ARG MAKE_ENV_CHMOD
ARG MAKE_ENV_CURL
ARG MAKE_ENV_GO
ARG MAKE_ENV_LN
ARG MAKE_ENV_MKDIR
ARG MAKE_ENV_MV
ARG MAKE_ENV_RM
ARG MAKE_ENV_TAR
ARG MAKE_ENV_TOUCH
ARG MAKE_ENV_UNZIP
ARG DOCKER_ARCH
ARG GO_ARCH
ARG GO_OS
ARG CHROME_IMAGE
ARG CHROME_VERSION
ARG YQ_MIRROR=github.com/mikefarah/yq/releases/download
ARG YQ_VERSION=v4.44.1
ARG YQ_URL=https://${YQ_MIRROR}/${YQ_VERSION}/yq_${GO_OS}_${GO_ARCH}.tar.gz
RUN ${MAKE_ENV_MKDIR} -p /opt/make-env/download /opt/make-env/bin \
&& ${MAKE_ENV_CURL} -vfL ${YQ_URL} | tar -x -z -C /opt/make-env/download ./yq_${GO_OS}_${GO_ARCH} \
&& ${MAKE_ENV_MV} /opt/make-env/download/./yq_${GO_OS}_${GO_ARCH} /opt/make-env/bin/yq \
&& ${MAKE_ENV_CHMOD} +x /opt/make-env/bin/yq
FROM ${CHROME_IMAGE}:${CHROME_VERSION} AS chrome
FROM docker.io/library/golang:1.20.4
ARG LOCALBIN=/usr/bin
ENV LOCALBIN=${LOCALBIN}
ENV PATH=${PATH}:${LOCALBIN}
RUN \
apt-get update -y \
&& apt-get install -y libnspr4 libnss3 libexpat1 libfontconfig1 libuuid1 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=chrome /headless-shell/ /headless-shell/
COPY --from=make-env-docker /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-docker-buildx /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-ginkgo /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-helm /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-helm-hog /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-kind /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-kubectl /opt/make-env/bin/. ${LOCALBIN}/
COPY --from=make-env-yq /opt/make-env/bin/. ${LOCALBIN}/
RUN mkdir -p /usr/lib/docker/cli-plugins \
&& ln -s ${LOCALBIN}/docker-buildx /usr/lib/docker/cli-plugins/
ENV LANG en-US.UTF-8
ENV PATH /headless-shell:$PATH
ENV RUNNING_IN_CONTAINER=1