Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
266 lines (196 loc) · 6.05 KB
/
Copy pathDockerfile
File metadata and controls
266 lines (196 loc) · 6.05 KB
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
ARG BASE_IMAGE=containerbase
#--------------------------------------
# Image: containerbase
#--------------------------------------
FROM ghcr.io/containerbase/ubuntu:24.04 AS containerbase
ENV BASH_ENV=/usr/local/etc/env
SHELL ["/bin/bash" , "-c"]
ARG TARGETARCH
COPY dist/docker/ /
COPY dist/cli/containerbase-cli-${TARGETARCH} /usr/local/containerbase/bin/containerbase-cli
ARG APT_HTTP_PROXY
ARG CONTAINERBASE_CDN
ARG CONTAINERBASE_DEBUG
ARG CONTAINERBASE_LOG_LEVEL
RUN install-containerbase
#--------------------------------------
# Image: base
#--------------------------------------
FROM ${BASE_IMAGE} AS base
RUN touch /.dummy
ARG APT_HTTP_PROXY
ARG CONTAINERBASE_CDN
ARG CONTAINERBASE_DEBUG
ARG CONTAINERBASE_LOG_LEVEL
COPY --chown=12021:0 test/python/test test
WORKDIR /test
#--------------------------------------
# build
#--------------------------------------
FROM base AS build
# Python
# renovate: datasource=github-releases packageName=containerbase/python-prebuild
RUN install-tool python 3.14.8
#--------------------------------------
# build-rootless
#--------------------------------------
FROM base AS build-rootless
RUN prepare-tool python conan
USER 12021
# renovate: datasource=github-releases packageName=containerbase/python-prebuild
RUN install-tool python 3.14.8
#--------------------------------------
# build: pipenv
#--------------------------------------
FROM build AS pipenv
# renovate: datasource=pypi
RUN install-tool pipenv 2026.8.0
# renovate: datasource=pypi
RUN install-tool pipenv 2026.8.0
USER 12021
#--------------------------------------
# build: poetry
#--------------------------------------
FROM build AS poetry
# renovate: datasource=pypi
RUN install-tool poetry 2.5.1
# renovate: datasource=pypi
RUN install-tool poetry 2.5.1
USER 12021
#--------------------------------------
# test pip-tools-a: pip-tools
#--------------------------------------
FROM build AS test-pip-tools-a
# renovate: datasource=pypi
RUN install-tool pip-tools 7.6.1
#--------------------------------------
# test pip-tools-b: pip-tools (older python)
#--------------------------------------
FROM base AS test-pip-tools-b
# python < 3.9 is not supported by the keyrings.envvars library that is installed along with pip-tools,
# so make sure we can still install on an older version
RUN install-tool python 3.8.18
# v7.5.3+ needs python 3.9+
RUN install-tool pip-tools 7.5.2
#--------------------------------------
# test poetry-a: (rootless)
#--------------------------------------
FROM build-rootless AS test-poetry-a
# try install again, sould skip
# renovate: datasource=github-releases packageName=containerbase/python-prebuild
RUN install-tool python 3.14.8
# renovate: datasource=pypi
RUN install-tool poetry 2.5.1
SHELL [ "/bin/sh", "-c" ]
RUN python --version
RUN poetry --version
RUN set -ex \
&& cd c-poetry \
&& poetry update --lock --no-interaction \
&& poetry add h5py \
;
#--------------------------------------
# test poetry-c: d-poetry
#--------------------------------------
FROM poetry AS test-poetry-c
RUN set -ex; cd d-poetry && poetry update --lock --no-interaction pytest
#--------------------------------------
# test poetry-d: poetry (old versions)
#--------------------------------------
FROM base AS test-poetry-d
# python 3.12+ not supported for poetry <1.7
RUN install-tool python 3.11.6
RUN install-tool poetry 0.12.17
RUN install-tool poetry 1.1.15
# python 3.14+ not supported for poetry <2
RUN install-tool python 3.13.6
RUN install-tool poetry 1.8.5
RUN set -ex; cd d-poetry && poetry update --lock --no-interaction pytest
#--------------------------------------
# poetry test e: root install - non root install
#--------------------------------------
FROM build AS test-poetry-e
# renovate: datasource=pypi
RUN install-tool poetry 2.5.1
USER 1001
# use older version
RUN install-tool python 3.10.0
# renovate: datasource=pypi
RUN install-tool poetry 2.5.1
#--------------------------------------
# test b: non-root
#--------------------------------------
FROM build-rootless AS testb
# renovate: datasource=pypi
RUN install-tool hashin 1.0.5
RUN set -ex \
&& cd f \
&& hashin distribute==0.6.27 \
&& cat requirements.txt \
;
# test old checkov with old python
RUN install-tool python 3.7.17
RUN install-tool checkov 2.3.298
#--------------------------------------
# test pipenv-a
#--------------------------------------
FROM pipenv AS test-pipenv-a
RUN set -ex; \
cd a; \
pipenv lock;
#--------------------------------------
# test pipenv-b (rootless)
#--------------------------------------
FROM build-rootless AS test-pipenv-b
# Do not update minor
RUN install-tool python 3.10.17
# make as latest
# renovate: datasource=github-releases packageName=containerbase/python-prebuild
RUN install-tool python 3.14.8
# renovate: datasource=pypi
RUN install-tool pipenv 2026.8.0
RUN set -ex; \
cd pipenv-b; \
pipenv lock;
#--------------------------------------
# test conan
#--------------------------------------
FROM build AS test-conan
RUN prepare-tool conan
USER 12021
# renovate: datasource=pypi
RUN install-tool conan 2.33.0
RUN set -ex; \
cd b-conan; \
conan lock create .; \
conan install . --build=missing; \
cat conan.lock
#--------------------------------------
# test install-pip
#--------------------------------------
FROM build-rootless AS test-other
RUN install-tool conan
RUN install-pip checkov
RUN install-pip copier
RUN install-pip hashin
RUN install-pip kas
RUN install-pip pdm
RUN install-pip pip-tools
RUN install-pip pipenv
RUN install-pip poetry
RUN install-pip uv
#--------------------------------------
# final
#--------------------------------------
FROM base
COPY --from=test-conan /.dummy /.dummy
COPY --from=test-pip-tools-a /.dummy /.dummy
COPY --from=test-pip-tools-b /.dummy /.dummy
COPY --from=test-poetry-a /.dummy /.dummy
COPY --from=test-poetry-c /.dummy /.dummy
COPY --from=test-poetry-d /.dummy /.dummy
COPY --from=test-poetry-e /.dummy /.dummy
COPY --from=test-pipenv-a /.dummy /.dummy
COPY --from=test-pipenv-b /.dummy /.dummy
COPY --from=testb /.dummy /.dummy
COPY --from=test-other /.dummy /.dummy