Skip to content

Commit 2c216f7

Browse files
committed
fixed java package, started seperating node modules to it's own layer
1 parent f92fe51 commit 2c216f7

File tree

132 files changed

+3775
-2985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+3775
-2985
lines changed

.automation/build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ def build_dockerfile(
283283
all_build_platform_dockerfile_items = []
284284
apk_packages = DEFAULT_DOCKERFILE_APK_PACKAGES.copy()
285285
apk_build_platform_packages = []
286+
apk_npm_packages = []
286287
npm_packages = []
287288
pip_packages = []
288289
pipvenv_packages = {}
@@ -449,6 +450,8 @@ def build_dockerfile(
449450
apk_packages += item["install"]["apk"]
450451
if "build_platform_apk" in item["install"]:
451452
apk_build_platform_packages += item["install"]["build_platform_apk"]
453+
if "npm_apk" in item["install"]:
454+
apk_npm_packages += item["install"]["npm_apk"]
452455
# Collect npm packages
453456
if "npm" in item["install"]:
454457
npm_packages += item["install"]["npm"]
@@ -485,8 +488,15 @@ def build_dockerfile(
485488
"RUN apk add --update --no-cache \\\n "
486489
+ " \\\n ".join(list(dict.fromkeys(apk_build_platform_packages)))
487490
)
491+
apk_npm_install_command = ""
492+
if len(apk_npm_packages) > 0:
493+
apk_npm_install_command = (
494+
"RUN apk add --update --no-cache \\\n "
495+
+ " \\\n ".join(list(dict.fromkeys(apk_npm_packages)))
496+
)
488497
replace_in_file(dockerfile, "#APK__START", "#APK__END", apk_install_command)
489498
replace_in_file(dockerfile, "#BUILD_PLATFORM_APK__START", "#BUILD_PLATFORM_APK__END", apk_build_platform_install_command)
499+
replace_in_file(dockerfile, "#NPM_APK__START", "#NPM_APK__END", apk_npm_install_command)
490500
# cargo packages
491501
cargo_install_command = ""
492502
# Pre-building packages

Dockerfile

Lines changed: 85 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
8484
#BUILD_PLATFORM_APK__START
8585
RUN apk add --update --no-cache \
8686
curl \
87-
java
87+
openjdk11
8888
#BUILD_PLATFORM_APK__END
8989

9090
#BUILD_PLATFORM_OTHER__START
@@ -223,6 +223,90 @@ RUN echo \
223223

224224
#PIPVENV__END
225225

226+
FROM python:3.11.3-alpine3.17 AS node_modules
227+
228+
#NPM_APK__START
229+
RUN apk add --update --no-cache gcc musl-dev libffi-dev rust cargo cmake make g++ openssl-dev
230+
#NPM_APK__END
231+
232+
############################
233+
# Install NPM dependencies #
234+
#############################################################################################
235+
## @generated by .automation/build.py using descriptor files, please do not update manually ##
236+
#############################################################################################
237+
238+
ENV NODE_OPTIONS="--max-old-space-size=8192" \
239+
NODE_ENV=production
240+
#NPM__START
241+
WORKDIR /node-deps
242+
RUN npm --no-cache install --ignore-scripts --omit=dev \
243+
sfdx-cli \
244+
typescript \
245+
@coffeelint/cli \
246+
jscpd \
247+
stylelint \
248+
stylelint-config-standard \
249+
stylelint-config-sass-guidelines \
250+
stylelint-scss \
251+
gherkin-lint \
252+
graphql \
253+
graphql-schema-linter \
254+
npm-groovy-lint \
255+
htmlhint \
256+
eslint \
257+
eslint-config-airbnb \
258+
eslint-config-prettier \
259+
eslint-config-standard \
260+
eslint-plugin-import \
261+
eslint-plugin-jest \
262+
eslint-plugin-node \
263+
eslint-plugin-prettier \
264+
eslint-plugin-promise \
265+
eslint-plugin-vue \
266+
@babel/core \
267+
@babel/eslint-parser \
268+
@microsoft/eslint-formatter-sarif \
269+
standard \
270+
prettier \
271+
@prantlf/jsonlint \
272+
eslint-plugin-jsonc \
273+
v8r \
274+
npm-package-json-lint \
275+
npm-package-json-lint-config-default \
276+
eslint-plugin-react \
277+
eslint-plugin-jsx-a11y \
278+
markdownlint-cli \
279+
markdown-link-check \
280+
markdown-table-formatter \
281+
@stoplight/spectral-cli \
282+
secretlint \
283+
@secretlint/secretlint-rule-preset-recommend \
284+
@secretlint/secretlint-formatter-sarif \
285+
cspell \
286+
sql-lint \
287+
tekton-lint \
288+
prettyjson \
289+
@typescript-eslint/eslint-plugin \
290+
@typescript-eslint/parser && \
291+
echo "Cleaning npm cache..." \
292+
&& npm cache clean --force || true \
293+
&& echo "Changing owner of node_modules files..." \
294+
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
295+
&& echo "Removing extra node_module files..." \
296+
&& rm -rf /root/.npm/_cacache \
297+
&& find . -name "*.d.ts" -delete \
298+
&& find . -name "*.map" -delete \
299+
&& find . -name "*.npmignore" -delete \
300+
&& find . -name "*.travis.yml" -delete \
301+
&& find . -name "CHANGELOG.md" -delete \
302+
&& find . -name "README.md" -delete \
303+
&& find . -name ".package-lock.json" -delete \
304+
&& find . -name "package-lock.json" -delete \
305+
&& find . -name "README.md" -delete
306+
WORKDIR /
307+
308+
#NPM__END
309+
226310
##################
227311
# Get base image #
228312
##################
@@ -353,84 +437,6 @@ COPY --link --from=python-venv /venvs /venvs
353437
ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin
354438
#PIPVENV_PATH__END
355439

356-
############################
357-
# Install NPM dependencies #
358-
#############################################################################################
359-
## @generated by .automation/build.py using descriptor files, please do not update manually ##
360-
#############################################################################################
361-
362-
ENV NODE_OPTIONS="--max-old-space-size=8192" \
363-
NODE_ENV=production
364-
#NPM__START
365-
WORKDIR /node-deps
366-
RUN npm --no-cache install --ignore-scripts --omit=dev \
367-
sfdx-cli \
368-
typescript \
369-
@coffeelint/cli \
370-
jscpd \
371-
stylelint \
372-
stylelint-config-standard \
373-
stylelint-config-sass-guidelines \
374-
stylelint-scss \
375-
gherkin-lint \
376-
graphql \
377-
graphql-schema-linter \
378-
npm-groovy-lint \
379-
htmlhint \
380-
eslint \
381-
eslint-config-airbnb \
382-
eslint-config-prettier \
383-
eslint-config-standard \
384-
eslint-plugin-import \
385-
eslint-plugin-jest \
386-
eslint-plugin-node \
387-
eslint-plugin-prettier \
388-
eslint-plugin-promise \
389-
eslint-plugin-vue \
390-
@babel/core \
391-
@babel/eslint-parser \
392-
@microsoft/eslint-formatter-sarif \
393-
standard \
394-
prettier \
395-
@prantlf/jsonlint \
396-
eslint-plugin-jsonc \
397-
v8r \
398-
npm-package-json-lint \
399-
npm-package-json-lint-config-default \
400-
eslint-plugin-react \
401-
eslint-plugin-jsx-a11y \
402-
markdownlint-cli \
403-
markdown-link-check \
404-
markdown-table-formatter \
405-
@stoplight/spectral-cli \
406-
secretlint \
407-
@secretlint/secretlint-rule-preset-recommend \
408-
@secretlint/secretlint-formatter-sarif \
409-
cspell \
410-
sql-lint \
411-
tekton-lint \
412-
prettyjson \
413-
@typescript-eslint/eslint-plugin \
414-
@typescript-eslint/parser && \
415-
echo "Cleaning npm cache..." \
416-
&& npm cache clean --force || true \
417-
&& echo "Changing owner of node_modules files..." \
418-
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
419-
&& echo "Removing extra node_module files..." \
420-
&& rm -rf /root/.npm/_cacache \
421-
&& find . -name "*.d.ts" -delete \
422-
&& find . -name "*.map" -delete \
423-
&& find . -name "*.npmignore" -delete \
424-
&& find . -name "*.travis.yml" -delete \
425-
&& find . -name "CHANGELOG.md" -delete \
426-
&& find . -name "README.md" -delete \
427-
&& find . -name ".package-lock.json" -delete \
428-
&& find . -name "package-lock.json" -delete \
429-
&& find . -name "README.md" -delete
430-
WORKDIR /
431-
432-
#NPM__END
433-
434440
# Add node packages to path #
435441
ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
436442
NODE_PATH="/node-deps/node_modules"

flavors/ci_light/Dockerfile

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,53 @@ RUN echo \
127127

128128
#PIPVENV__END
129129

130+
FROM python:3.11.3-alpine3.17 AS node_modules
131+
132+
#NODE_MODULES_APK__START
133+
RUN apk add --update --no-cache gcc musl-dev libffi-dev rust cargo cmake make g++ openssl-dev
134+
#NODE_MODULES_APK__END
135+
136+
############################
137+
# Install NPM dependencies #
138+
#############################################################################################
139+
## @generated by .automation/build.py using descriptor files, please do not update manually ##
140+
#############################################################################################
141+
142+
ENV NODE_OPTIONS="--max-old-space-size=8192" \
143+
NODE_ENV=production
144+
#NPM__START
145+
WORKDIR /node-deps
146+
RUN npm --no-cache install --ignore-scripts --omit=dev \
147+
jscpd \
148+
npm-groovy-lint \
149+
@prantlf/jsonlint \
150+
eslint \
151+
eslint-plugin-jsonc \
152+
@microsoft/eslint-formatter-sarif \
153+
v8r \
154+
prettier \
155+
secretlint \
156+
@secretlint/secretlint-rule-preset-recommend \
157+
@secretlint/secretlint-formatter-sarif && \
158+
echo "Cleaning npm cache..." \
159+
&& npm cache clean --force || true \
160+
&& echo "Changing owner of node_modules files..." \
161+
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
162+
&& echo "Removing extra node_module files..." \
163+
&& rm -rf /root/.npm/_cacache \
164+
&& find . -name "*.d.ts" -delete \
165+
&& find . -name "*.map" -delete \
166+
&& find . -name "*.npmignore" -delete \
167+
&& find . -name "*.travis.yml" -delete \
168+
&& find . -name "CHANGELOG.md" -delete \
169+
&& find . -name "README.md" -delete \
170+
&& find . -name ".package-lock.json" -delete \
171+
&& find . -name "package-lock.json" -delete \
172+
&& find . -name "README.md" -delete
173+
WORKDIR /
174+
175+
#NPM__END
176+
130177
##################
131178
# Get base image #
132179
##################
@@ -212,47 +259,6 @@ COPY --link --from=python-venv /venvs /venvs
212259
ENV PATH="${PATH}":/venvs/yamllint/bin
213260
#PIPVENV_PATH__END
214261

215-
############################
216-
# Install NPM dependencies #
217-
#############################################################################################
218-
## @generated by .automation/build.py using descriptor files, please do not update manually ##
219-
#############################################################################################
220-
221-
ENV NODE_OPTIONS="--max-old-space-size=8192" \
222-
NODE_ENV=production
223-
#NPM__START
224-
WORKDIR /node-deps
225-
RUN npm --no-cache install --ignore-scripts --omit=dev \
226-
jscpd \
227-
npm-groovy-lint \
228-
@prantlf/jsonlint \
229-
eslint \
230-
eslint-plugin-jsonc \
231-
@microsoft/eslint-formatter-sarif \
232-
v8r \
233-
prettier \
234-
secretlint \
235-
@secretlint/secretlint-rule-preset-recommend \
236-
@secretlint/secretlint-formatter-sarif && \
237-
echo "Cleaning npm cache..." \
238-
&& npm cache clean --force || true \
239-
&& echo "Changing owner of node_modules files..." \
240-
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
241-
&& echo "Removing extra node_module files..." \
242-
&& rm -rf /root/.npm/_cacache \
243-
&& find . -name "*.d.ts" -delete \
244-
&& find . -name "*.map" -delete \
245-
&& find . -name "*.npmignore" -delete \
246-
&& find . -name "*.travis.yml" -delete \
247-
&& find . -name "CHANGELOG.md" -delete \
248-
&& find . -name "README.md" -delete \
249-
&& find . -name ".package-lock.json" -delete \
250-
&& find . -name "package-lock.json" -delete \
251-
&& find . -name "README.md" -delete
252-
WORKDIR /
253-
254-
#NPM__END
255-
256262
# Add node packages to path #
257263
ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
258264
NODE_PATH="/node-deps/node_modules"

0 commit comments

Comments
 (0)