From 68893580d06f7b8d3b6a0c6df59c26b84ada8a8f Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Mon, 6 Jan 2025 20:14:44 +0000 Subject: [PATCH] Bundle locally built cli in the container images Signed-off-by: Prabhu Subramanian --- ci/base-images/cdxgen/Dockerfile.dotnet6 | 2 ++ ci/base-images/cdxgen/Dockerfile.dotnet7 | 2 ++ ci/base-images/cdxgen/Dockerfile.dotnet8 | 2 ++ ci/base-images/cdxgen/Dockerfile.dotnet9 | 2 ++ ci/base-images/cdxgen/Dockerfile.java | 2 ++ ci/base-images/cdxgen/Dockerfile.java-slim | 2 ++ ci/base-images/cdxgen/Dockerfile.java17 | 2 ++ ci/base-images/cdxgen/Dockerfile.java17-slim | 2 ++ ci/base-images/cdxgen/Dockerfile.node20 | 2 ++ ci/base-images/cdxgen/Dockerfile.python | 2 ++ ci/base-images/cdxgen/Dockerfile.python310 | 2 ++ ci/base-images/cdxgen/Dockerfile.python311 | 2 ++ ci/base-images/cdxgen/Dockerfile.python36 | 2 ++ ci/base-images/cdxgen/Dockerfile.python39 | 2 ++ ci/base-images/cdxgen/Dockerfile.rolling | 2 ++ ci/base-images/cdxgen/debian/Dockerfile.dotnet8 | 2 ++ ci/base-images/cdxgen/debian/Dockerfile.dotnet9 | 2 ++ 17 files changed, 34 insertions(+) diff --git a/ci/base-images/cdxgen/Dockerfile.dotnet6 b/ci/base-images/cdxgen/Dockerfile.dotnet6 index 7f9be9936c..678a9acf8c 100644 --- a/ci/base-images/cdxgen/Dockerfile.dotnet6 +++ b/ci/base-images/cdxgen/Dockerfile.dotnet6 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.dotnet7 b/ci/base-images/cdxgen/Dockerfile.dotnet7 index 375d626d11..8f32131818 100644 --- a/ci/base-images/cdxgen/Dockerfile.dotnet7 +++ b/ci/base-images/cdxgen/Dockerfile.dotnet7 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.dotnet8 b/ci/base-images/cdxgen/Dockerfile.dotnet8 index 29286f6313..4287e75f0b 100644 --- a/ci/base-images/cdxgen/Dockerfile.dotnet8 +++ b/ci/base-images/cdxgen/Dockerfile.dotnet8 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.dotnet9 b/ci/base-images/cdxgen/Dockerfile.dotnet9 index dbe36afe75..868c56bc78 100644 --- a/ci/base-images/cdxgen/Dockerfile.dotnet9 +++ b/ci/base-images/cdxgen/Dockerfile.dotnet9 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.java b/ci/base-images/cdxgen/Dockerfile.java index 8a78233d22..4b25744e36 100644 --- a/ci/base-images/cdxgen/Dockerfile.java +++ b/ci/base-images/cdxgen/Dockerfile.java @@ -16,6 +16,8 @@ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.java-slim b/ci/base-images/cdxgen/Dockerfile.java-slim index b8c5883543..b7e5da3f50 100644 --- a/ci/base-images/cdxgen/Dockerfile.java-slim +++ b/ci/base-images/cdxgen/Dockerfile.java-slim @@ -15,6 +15,8 @@ ENV CDXGEN_IN_CONTAINER=true \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" ENV PATH=${PATH}:/usr/local/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.java17 b/ci/base-images/cdxgen/Dockerfile.java17 index 78448c018e..0f00621ab8 100644 --- a/ci/base-images/cdxgen/Dockerfile.java17 +++ b/ci/base-images/cdxgen/Dockerfile.java17 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.java17-slim b/ci/base-images/cdxgen/Dockerfile.java17-slim index 38b36b3649..9a7b88e66a 100644 --- a/ci/base-images/cdxgen/Dockerfile.java17-slim +++ b/ci/base-images/cdxgen/Dockerfile.java17-slim @@ -15,6 +15,8 @@ ENV CDXGEN_IN_CONTAINER=true \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" ENV PATH=${PATH}:/usr/local/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.node20 b/ci/base-images/cdxgen/Dockerfile.node20 index 0a9b826de9..40715510d8 100644 --- a/ci/base-images/cdxgen/Dockerfile.node20 +++ b/ci/base-images/cdxgen/Dockerfile.node20 @@ -15,6 +15,8 @@ ENV CDXGEN_IN_CONTAINER=true \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" ENV PATH=${PATH}:/usr/local/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/Dockerfile.python b/ci/base-images/cdxgen/Dockerfile.python index dbc5bc91db..9126cc3eb3 100644 --- a/ci/base-images/cdxgen/Dockerfile.python +++ b/ci/base-images/cdxgen/Dockerfile.python @@ -25,6 +25,8 @@ ENV NVM_DIR="/root/.nvm" \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \ PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin: +COPY . /opt/cdxgen + RUN source /root/.nvm/nvm.sh \ && zypper --non-interactive install -l --no-recommends clang7 llvm7 llvm7-devel libcurl-devel libjpeg62-devel libmariadb-devel \ postgresql-devel postgresql16-server-devel libopenssl-devel libopenblas_pthreads-devel lapacke-devel \ diff --git a/ci/base-images/cdxgen/Dockerfile.python310 b/ci/base-images/cdxgen/Dockerfile.python310 index 2eaf67ffa0..f267206664 100644 --- a/ci/base-images/cdxgen/Dockerfile.python310 +++ b/ci/base-images/cdxgen/Dockerfile.python310 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 +COPY . /opt/cdxgen + RUN zypper --non-interactive install --allow-downgrade -l --no-recommends readline-devel clang13 llvm13 llvm13-devel libjpeg62-devel libmariadb-devel \ postgresql16-devel postgresql16-server-devel libopenssl-devel libopenblas_pthreads-devel lapacke-devel graphviz-devel \ && cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ diff --git a/ci/base-images/cdxgen/Dockerfile.python311 b/ci/base-images/cdxgen/Dockerfile.python311 index 3faaf662cd..5a89d3c4c1 100644 --- a/ci/base-images/cdxgen/Dockerfile.python311 +++ b/ci/base-images/cdxgen/Dockerfile.python311 @@ -26,6 +26,8 @@ ENV NVM_DIR="/root/.nvm" \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \ PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin: +COPY . /opt/cdxgen + RUN source /root/.nvm/nvm.sh \ && zypper --non-interactive install -l --no-recommends clang7 llvm7 llvm7-devel libcurl-devel libjpeg62-devel libmariadb-devel \ postgresql-devel postgresql16-server-devel libopenssl-devel libopenblas_pthreads-devel lapacke-devel graphviz-devel \ diff --git a/ci/base-images/cdxgen/Dockerfile.python36 b/ci/base-images/cdxgen/Dockerfile.python36 index 48ebde650e..6a29783d1d 100644 --- a/ci/base-images/cdxgen/Dockerfile.python36 +++ b/ci/base-images/cdxgen/Dockerfile.python36 @@ -26,6 +26,8 @@ ENV NVM_DIR="/root/.nvm" \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \ PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin: +COPY . /opt/cdxgen + RUN source /root/.nvm/nvm.sh \ && zypper --non-interactive install -l --no-recommends clang7 llvm7 llvm7-devel libcurl-devel libjpeg62-devel libmariadb-devel \ postgresql-devel postgresql16-server-devel libopenssl-devel libopenblas_pthreads-devel lapacke-devel \ diff --git a/ci/base-images/cdxgen/Dockerfile.python39 b/ci/base-images/cdxgen/Dockerfile.python39 index c111058826..5779305351 100644 --- a/ci/base-images/cdxgen/Dockerfile.python39 +++ b/ci/base-images/cdxgen/Dockerfile.python39 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ NODE_COMPILE_CACHE="/opt/cdxgen-node-cache" \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 +COPY . /opt/cdxgen + RUN zypper --non-interactive install --allow-downgrade -l --no-recommends readline-devel clang13 llvm13 llvm13-devel libjpeg62-devel libmariadb-devel \ postgresql16-devel postgresql16-server-devel libopenssl-devel libopenblas_pthreads-devel lapacke-devel graphviz-devel \ && cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ diff --git a/ci/base-images/cdxgen/Dockerfile.rolling b/ci/base-images/cdxgen/Dockerfile.rolling index 6bd0f3ca1a..ab52268531 100644 --- a/ci/base-images/cdxgen/Dockerfile.rolling +++ b/ci/base-images/cdxgen/Dockerfile.rolling @@ -18,6 +18,8 @@ LABEL maintainer="CycloneDX" \ org.opencontainers.image.description="Rolling image with cdxgen SBOM generator based on tumbleweed" \ org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-rolling:v11 -r /app --server" +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 b/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 index 3910e00c93..b3289e578c 100644 --- a/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 +++ b/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \ diff --git a/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 b/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 index fb5823e02f..a2537ae2bc 100644 --- a/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 +++ b/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 @@ -16,6 +16,8 @@ ENV CDXGEN_IN_CONTAINER=true \ PYTHONPATH=/opt/pypi ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: +COPY . /opt/cdxgen + RUN cd /opt/cdxgen && corepack enable && corepack pnpm install --prod --package-import-method copy && corepack pnpm cache delete \ && mkdir -p /opt/cdxgen-node-cache \ && chown -R cyclonedx:cyclonedx /opt/cdxgen /opt/cdxgen-node-cache \