@@ -17,21 +17,18 @@ ENV user=dependencycheck
1717ENV JAVA_HOME=/opt/jdk
1818ENV JAVA_OPTS="-Danalyzer.assembly.dotnet.path=/usr/bin/dotnet -Danalyzer.bundle.audit.path=/usr/bin/bundle-audit -Danalyzer.golang.path=/usr/local/go/bin/go"
1919ENV ODC_NAME=dependency-check-docker
20+ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=false
2021
2122COPY --from=jlink /jlinked /opt/jdk/
2223COPY --from=go /usr/local/go/ /usr/local/go/
2324
2425ADD cli/target/dependency-check-${VERSION}-release.zip /
2526
26- RUN apk update && \
27- apk add --no-cache --virtual .build-deps curl tar && \
28- apk add --no-cache git ruby ruby-rdoc npm && \
29- gem install bundler-audit && \
30- bundle audit update && \
31- mkdir /opt/yarn && \
32- curl -Ls https://yarnpkg.com/latest.tar.gz | tar -xz --strip-components=1 --directory /opt/yarn && \
33- ln -s /opt/yarn/bin/yarn /usr/bin/yarn && \
34- npm install -g pnpm && \
27+ RUN apk upgrade --no-cache && \
28+ apk add --no-cache --virtual .build-deps curl && \
29+ apk add --no-cache git ruby npm && \
30+ gem install --no-document bundler-audit && \
31+ npm install --global --ignore-scripts corepack && \
3532 unzip dependency-check-${VERSION}-release.zip -d /usr/share/ && \
3633 rm dependency-check-${VERSION}-release.zip && \
3734 cd /usr/share/dependency-check/plugins && \
@@ -44,12 +41,19 @@ RUN apk update
4441 mkdir /report && \
4542 chown -R ${user}:0 /report && \
4643 chmod -R g=u /report && \
47- apk del .build-deps
44+ apk del .build-deps && \
45+ rm -rf /tmp/* /root/.cache /root/.npm
4846
4947# ## remove any suid sgid - we don't need them
5048RUN find / -path /proc -prune -perm +6000 -type f -exec chmod a-s {} \;
5149USER ${UID}
5250
51+ # ## Cache pieces needed for the specific run user
52+ RUN bundle audit update && \
53+ corepack prepare pnpm@latest yarn@latest yarn@1 --activate && \
54+ printf "enableTelemetry: false\n enableScripts: false\n " >> ${HOME}/.yarnrc.yml && \
55+ rm -rf /tmp/*
56+
5357VOLUME ["/src" , "/report" ]
5458
5559WORKDIR /src
0 commit comments