@@ -4,7 +4,7 @@ LABEL maintainer="cyclonedx" \
4
4
org.opencontainers.image.authors="Prabhu Subramanian <prabhu@appthreat.com>" \
5
5
org.opencontainers.image.source="https://github.com/cyclonedx/cdxgen" \
6
6
org.opencontainers.image.url="https://github.com/cyclonedx/cdxgen" \
7
- org.opencontainers.image.version="11.3 .x" \
7
+ org.opencontainers.image.version="11.4 .x" \
8
8
org.opencontainers.image.vendor="cyclonedx" \
9
9
org.opencontainers.image.licenses="Apache-2.0" \
10
10
org.opencontainers.image.title="cdxgen" \
@@ -22,8 +22,8 @@ ARG MAVEN_VERSION=3.9.9
22
22
ARG GRADLE_VERSION=8.14
23
23
ARG GO_VERSION=1.24.3
24
24
ARG NODE_VERSION=24.0.2
25
- ARG PYTHON_VERSION=3.12
26
25
ARG RUBY_VERSION=3.4.3
26
+ ARG JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8"
27
27
ARG SCALA_VERSION=3.6.4
28
28
29
29
ENV GOPATH=/opt/app-root/go \
@@ -32,19 +32,18 @@ ENV GOPATH=/opt/app-root/go \
32
32
MAVEN_VERSION=$MAVEN_VERSION \
33
33
GRADLE_VERSION=$GRADLE_VERSION \
34
34
GRADLE_OPTS="-Dorg.gradle.daemon=false" \
35
- JAVA_HOME="/root /.sdkman/candidates/java/${JAVA_VERSION}" \
36
- MAVEN_HOME="/root /.sdkman/candidates/maven/${MAVEN_VERSION}" \
37
- GRADLE_HOME="/root /.sdkman/candidates/gradle/${GRADLE_VERSION}" \
38
- SBT_HOME="/root /.sdkman/candidates/sbt/${SBT_VERSION}" \
35
+ JAVA_HOME="/opt /.sdkman/candidates/java/${JAVA_VERSION}" \
36
+ MAVEN_HOME="/opt /.sdkman/candidates/maven/${MAVEN_VERSION}" \
37
+ GRADLE_HOME="/opt /.sdkman/candidates/gradle/${GRADLE_VERSION}" \
38
+ SBT_HOME="/opt /.sdkman/candidates/sbt/${SBT_VERSION}" \
39
39
SCALA_VERSION=$SCALA_VERSION \
40
- SCALA_HOME="/root/.sdkman/candidates/scala/${SCALA_VERSION}" \
41
- PYTHON_VERSION=3.12 \
42
- PYTHON_CMD=/usr/bin/python3.12 \
40
+ SCALA_HOME="/opt/.sdkman/candidates/scala/${SCALA_VERSION}" \
41
+ PYTHON_CMD=/usr/bin/python3 \
43
42
RUBY_VERSION=$RUBY_VERSION \
44
43
PYTHONUNBUFFERED=1 \
45
44
PYTHONIOENCODING="utf-8" \
46
45
COMPOSER_ALLOW_SUPERUSER=1 \
47
- JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8 --enable-native-access=ALL-UNNAMED" \
46
+ JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS \
48
47
SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
49
48
SWIFT_PLATFORM=$SWIFT_PLATFORM \
50
49
SWIFT_BRANCH=$SWIFT_BRANCH \
@@ -53,16 +52,17 @@ ENV GOPATH=/opt/app-root/go \
53
52
LC_ALL=en_US.UTF-8 \
54
53
LANG=en_US.UTF-8 \
55
54
LANGUAGE=en_US.UTF-8 \
56
- NVM_DIR="/root /.nvm" \
55
+ NVM_DIR="/opt /.nvm" \
57
56
TMPDIR=/tmp \
57
+ DOTNET_CLI_TELEMETRY_OPTOUT=1 \
58
58
NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \
59
59
PYTHONPATH=/opt/pypi:${PYTHONPATH} \
60
60
CDXGEN_IN_CONTAINER=true \
61
- SDKMAN_DIR=/root/.sdkman \
62
- SDKMAN_CANDIDATES_DIR=/root /.sdkman/candidates \
63
- DOTNET_CLI_TELEMETRY_OPTOUT=1 \
61
+ CDXGEN_TEMP_DIR=/tmp/cdxgen-temp \
62
+ SDKMAN_DIR=/opt /.sdkman \
63
+ SDKMAN_CANDIDATES_DIR=/opt/.sdkman/candidates \
64
64
RBENV_ROOT=/opt/.rbenv
65
- ENV PATH=${PATH}:/root/ .nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${GRADLE_HOME}/bin:${SCALA_HOME}/bin:${SBT_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:/usr/local/bin/:/root /.local/bin:/root/.cargo /bin:/opt/pypi/bin:/opt/.rbenv/bin:/opt/.rbenv/versions/3.4.3/bin:
65
+ ENV PATH=${PATH}:/opt/bin:/opt/ .nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${GRADLE_HOME}/bin:${SCALA_HOME}/bin:${SBT_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:/usr/local/bin/:/opt /.local/bin:/opt/pypi/bin:/opt/.rbenv/bin:/opt/.rbenv/versions/3.4.3/bin:
66
66
67
67
COPY . /opt/cdxgen
68
68
@@ -81,34 +81,32 @@ RUN set -e; \
81
81
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'" ; exit 1 ;; \
82
82
esac \
83
83
&& microdnf install -y php php-curl php-zip php-bcmath php-json php-pear php-mbstring php-devel make gcc git-core \
84
- python${PYTHON_VERSION} python${PYTHON_VERSION} -devel python${PYTHON_VERSION} -pip glibc-common glibc-all-langpacks \
84
+ python3 python3 -devel python3 -pip glibc-common glibc-all-langpacks \
85
85
openssl-devel libffi-devel libyaml zlib-devel \
86
- pcre2 which tar gzip zip unzip bzip2 sudo ncurses ncurses-devel sqlite-devel gnupg2 dotnet-sdk-9.0 \
86
+ pcre2 which tar gzip zip unzip bzip2 sudo ncurses ncurses-devel sqlite-devel gnupg2 dotnet-sdk-9.0 rust cargo \
87
87
&& ruby --version \
88
88
&& which ruby \
89
- && alternatives --install /usr/bin/python3 python /usr/bin/python${PYTHON_VERSION} 10 \
90
- && alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 10 \
91
- && /usr/bin/python${PYTHON_VERSION} --version \
92
- && /usr/bin/python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade setuptools==77.0.3 wheel pip virtualenv \
93
- && /usr/bin/python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pipenv poetry blint atom-tools uv --target /opt/pypi \
89
+ && /usr/bin/python3 --version \
90
+ && /usr/bin/python3 -m pip install --no-cache-dir --upgrade setuptools==77.0.3 wheel pip virtualenv \
91
+ && /usr/bin/python3 -m pip install --no-cache-dir --upgrade pipenv poetry blint atom-tools uv --target /opt/pypi \
94
92
&& /opt/pypi/bin/poetry --version \
95
93
&& /opt/pypi/bin/pipenv --version \
96
94
&& /opt/pypi/bin/blint --help \
97
- && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
95
+ && mkdir -p /opt/bin /opt/.nvm /tmp/cdxgen-temp \
98
96
&& cargo --version \
99
97
&& rustc --version \
100
98
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \
101
- && source /root/.nvm /nvm.sh \
99
+ && source ${NVM_DIR} /nvm.sh \
102
100
&& nvm install ${NODE_VERSION} \
103
101
&& node --version \
104
102
&& curl -s "https://get.sdkman.io" | bash \
105
- && echo -e "sdkman_auto_answer=true\n sdkman_selfupdate_feature=false\n sdkman_auto_env=true\n sdkman_curl_connect_timeout=20\n sdkman_curl_max_time=0" >> $HOME /.sdkman/etc/config \
106
- && source "$HOME /.sdkman/bin/sdkman-init.sh" \
107
- && sdk install java $JAVA_VERSION \
108
- && sdk install maven $MAVEN_VERSION \
109
- && sdk install gradle $GRADLE_VERSION \
110
- && sdk install scala $SCALA_VERSION \
111
- && sdk install sbt $SBT_VERSION \
103
+ && echo -e "sdkman_auto_answer=true\n sdkman_selfupdate_feature=false\n sdkman_auto_env=true\n sdkman_curl_connect_timeout=20\n sdkman_curl_max_time=0" >> /opt /.sdkman/etc/config \
104
+ && source "/opt /.sdkman/bin/sdkman-init.sh" \
105
+ && sdk install java $JAVA_VERSION /opt/.sdkman/candidates/java \
106
+ && sdk install maven $MAVEN_VERSION /opt/.sdkman/candidates/maven \
107
+ && sdk install gradle $GRADLE_VERSION /opt/.sdkman/candidates/gradle \
108
+ && sdk install scala $SCALA_VERSION /opt/.sdkman/candidates/scala \
109
+ && sdk install sbt $SBT_VERSION /opt/.sdkman/candidates/sbt \
112
110
&& SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
113
111
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
114
112
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
@@ -131,10 +129,12 @@ RUN set -e; \
131
129
&& /usr/local/bin/lein \
132
130
&& curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh \
133
131
&& chmod +x linux-install.sh \
134
- && ./linux-install.sh \
132
+ && ./linux-install.sh && rm linux-install.sh \
135
133
&& curl -L --output /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-${GOBIN_VERSION} \
136
134
&& chmod +x /usr/local/bin/bazel \
137
135
&& useradd -ms /bin/bash cyclonedx \
136
+ && mv /root/.bashrc /home/cyclonedx/.bashrc \
137
+ && chown -R cyclonedx:cyclonedx /home/cyclonedx/.bashrc \
138
138
&& npm install --global corepack@latest \
139
139
&& npm install -g node-gyp @microsoft/rush --omit=dev \
140
140
&& npx node-gyp install \
@@ -146,12 +146,14 @@ RUN set -e; \
146
146
&& gem install bundler cocoapods \
147
147
&& gem --version \
148
148
&& bundler --version \
149
- && cd /opt/cdxgen && corepack enable && corepack pnpm install --config.strict-dep-builds=true --prod --package-import-method copy --frozen-lockfile && corepack pnpm cache delete \
149
+ && cd /opt/cdxgen && corepack enable pnpm && pnpm config set global-bin-dir /opt/bin \
150
+ && pnpm install --config.strict-dep-builds=true --prod --package-import-method copy --frozen-lockfile && pnpm link && pnpm cache delete \
151
+ && pnpm bin && pnpm bin -g \
150
152
&& mkdir -p /opt/cdxgen-node-cache \
151
153
&& chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \
152
154
&& chmod a-w -R /opt \
153
- && node /opt/cdxgen/bin/cdxgen.js --help \
154
155
&& rm -rf /var/cache/yum /root/.cache/pypoetry /root/.cache/node \
155
156
&& microdnf clean all
157
+ USER cyclonedx
156
158
WORKDIR /app
157
- ENTRYPOINT ["node" , "/opt/ cdxgen/bin/cdxgen.js " ]
159
+ ENTRYPOINT ["cdxgen" ]
0 commit comments