Skip to content

Commit 200bd74

Browse files
Add image for Rust 1.87 (#1819)
* Add image for Rust 1.87 added docker image for Rust 1.87 with suitable tags such as debian-rust187, debian-rust, cdxgen-debian-rust187, cdxgen-debian-rust. Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com> * fix env path Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com> * suggested changes Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com> * readme changes Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com> * fix python path and rust image versioning Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com> --------- Signed-off-by: bandhan-majumder <bandhanmajumder16@gmail.com>
1 parent bb821cb commit 200bd74

File tree

9 files changed

+68
-5
lines changed

9 files changed

+68
-5
lines changed

.github/workflows/build-images.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ jobs:
115115
distro: debian
116116
runner: macos-hosted
117117

118+
- lang: rust1
119+
distro: debian
120+
base-image:
121+
additional-image: debian-rust
122+
cdxgen-image:
123+
additional-image: cdxgen-debian-rust
124+
118125
- lang: swift6
119126
distro: debian
120127
runner: macos-hosted

ci/base-images/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Below table summarizes all available container image versions. These images incl
3636
| Swift | 6.0.x | ghcr.io/cyclonedx/cdxgen-debian-swift:v11 |
3737
| golang | 1.24 | ghcr.io/cyclonedx/cdxgen-debian-golang124:v11, ghcr.io/cyclonedx/cdxgen-debian-golang:v11 | Golang 1.24 |
3838
| golang | 1.23 | ghcr.io/cyclonedx/cdxgen-debian-golang123:v11 | Golang 1.23 |
39+
| Rust | 1 | ghcr.io/cyclonedx/cdxgen-debian-rust, ghcr.io/cyclonedx/cdxgen-debian-rust1:v11 | This is a rolling version that will get the latest released version. Currently, 1.87. |
3940

4041
Replace `:v11` with a release version tag or sha256 hash for fine-grained control over the image tag.
4142

ci/base-images/cdxgen/debian/Dockerfile.golang123

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LABEL maintainer="CycloneDX" \
1313

1414
ENV CDXGEN_IN_CONTAINER=true \
1515
NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \
16-
PYTHONPATH=/opt/pypi
16+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
1717
ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin:/opt/cdxgen/node_modules/.bin:
1818

1919
COPY . /opt/cdxgen

ci/base-images/cdxgen/debian/Dockerfile.golang124

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LABEL maintainer="CycloneDX" \
1313

1414
ENV CDXGEN_IN_CONTAINER=true \
1515
NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \
16-
PYTHONPATH=/opt/pypi
16+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
1717
ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin:/opt/cdxgen/node_modules/.bin:
1818

1919
COPY . /opt/cdxgen
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM ghcr.io/cyclonedx/debian-rust1:master
2+
3+
LABEL maintainer="CycloneDX" \
4+
org.opencontainers.image.authors="Team AppThreat <cloud@appthreat.com>" \
5+
org.opencontainers.image.source="https://github.com/CycloneDX/cdxgen" \
6+
org.opencontainers.image.url="https://github.com/CycloneDX/cdxgen" \
7+
org.opencontainers.image.version="rolling" \
8+
org.opencontainers.image.vendor="CycloneDX" \
9+
org.opencontainers.image.licenses="Apache-2.0" \
10+
org.opencontainers.image.title="cdxgen" \
11+
org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for rust apps" \
12+
org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-rust1:v11 -r /app --server"
13+
14+
ENV CDXGEN_IN_CONTAINER=true \
15+
NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \
16+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
17+
ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin:/opt/cdxgen/node_modules/.bin:
18+
19+
COPY . /opt/cdxgen
20+
21+
RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --config.strict-dep-builds=true --prod --package-import-method copy --frozen-lockfile && corepack pnpm cache delete \
22+
&& npm install -g @appthreat/atom-parsetools \
23+
&& mkdir -p /opt/cdxgen-node-cache \
24+
&& node /opt/cdxgen/bin/cdxgen.js --help \
25+
&& pip install --upgrade --no-cache-dir atom-tools --target /opt/pypi \
26+
&& rbastgen --help \
27+
&& rm -rf ${CDXGEN_GEM_HOME} && mkdir -p ${CDXGEN_GEM_HOME} \
28+
&& rm -rf /root/.cache/node \
29+
&& chmod a-w -R /opt
30+
WORKDIR /app
31+
ENTRYPOINT ["node", "/opt/cdxgen/bin/cdxgen.js"]

ci/base-images/cdxgen/opensuse/Dockerfile.rolling

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV CDXGEN_DEBUG_MODE=debug \
1515
SCAN_DEBUG_MODE=debug \
1616
CDXGEN_IN_CONTAINER=true \
1717
NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \
18-
PYTHONPATH=/opt/pypi
18+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
1919
ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin:/opt/cdxgen/node_modules/.bin:
2020

2121
COPY . /opt/cdxgen
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM rust:1-slim-bookworm
2+
3+
ARG NODE_VERSION=24.0.2
4+
5+
ENV CARGO_HOME=/usr/local/cargo \
6+
RUSTUP_HOME=/usr/local/rustup \
7+
RUST_BACKTRACE=1 \
8+
NVM_DIR="/root/.nvm"
9+
10+
ENV PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/bin:/root/.local/bin:${CARGO_HOME}/bin:
11+
12+
COPY ci/base-images/debian/install.sh /tmp/
13+
14+
RUN apt-get update && apt-get install -qq -y --no-install-recommends curl bash bzip2 git-core zip unzip make gawk \
15+
&& apt-get install -qq -y build-essential python3 python3-pip python3-dev pkg-config libssl-dev locales \
16+
&& chmod +x /tmp/install.sh \
17+
&& /tmp/install.sh && rm /tmp/install.sh \
18+
&& node -v \
19+
&& npm -v \
20+
&& rustc --version \
21+
&& cargo --version \
22+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
23+
&& rm -rf /var/lib/apt/lists/*
24+
CMD ["/bin/bash"]

ci/base-images/opensuse/Dockerfile.rolling

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ENV SBT_VERSION=$SBT_VERSION \
2525
LANG=en_US.UTF-8 \
2626
LANGUAGE=en_US.UTF-8 \
2727
DOTNET_ROOT=/usr/share/dotnet \
28-
PYTHONPATH=/opt/pypi
28+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
2929

3030
ENV PATH=${PATH}:${MAVEN_HOME}/bin:${GRADLE_HOME}/bin:${SCALA_HOME}/bin:${SBT_HOME}/bin:/usr/local/bin:/opt/pypi/bin:/usr/share/dotnet:
3131
RUN set -e; \

ci/base-images/sle/Dockerfile.python311

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV JAVA_VERSION=$JAVA_VERSION \
1515
LANG=en_US.UTF-8 \
1616
LANGUAGE=en_US.UTF-8 \
1717
NVM_DIR="/root/.nvm" \
18-
PYTHONPATH=/opt/pypi
18+
PYTHONPATH=/opt/pypi:${PYTHONPATH}
1919
ENV PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:/usr/local/bin:/opt/pypi/bin:${GOPATH}/bin:/usr/local/go/bin:
2020
RUN set -e; \
2121
ARCH_NAME="$(rpm --eval '%{_arch}')"; \

0 commit comments

Comments
 (0)