From 0eaaa06932a130c11385e1bd3ceca293686592a8 Mon Sep 17 00:00:00 2001 From: prabhu <7842+prabhu@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:56:50 +0000 Subject: [PATCH] debian based dotnet images (#1529) * Added debian dotnet images Signed-off-by: Prabhu Subramanian --------- Signed-off-by: Prabhu Subramanian --- .github/workflows/build-base-images.yml | 242 ++++++++++++++++++ ci/base-images/README.md | 20 ++ ci/base-images/cdxgen/Dockerfile.dotnet9 | 2 +- .../cdxgen/debian/Dockerfile.dotnet6 | 21 ++ .../cdxgen/debian/Dockerfile.dotnet8 | 21 ++ .../cdxgen/debian/Dockerfile.dotnet9 | 21 ++ ci/base-images/debian/Dockerfile.dotnet6 | 37 +++ ci/base-images/debian/Dockerfile.dotnet8 | 33 +++ ci/base-images/debian/Dockerfile.dotnet9 | 33 +++ ci/base-images/debian/install.sh | 23 ++ ci/base-images/opensuse/Dockerfile.lang | 4 +- ci/base-images/opensuse/Dockerfile.python310 | 4 +- ci/base-images/opensuse/Dockerfile.python39 | 4 +- 13 files changed, 458 insertions(+), 7 deletions(-) create mode 100644 ci/base-images/cdxgen/debian/Dockerfile.dotnet6 create mode 100644 ci/base-images/cdxgen/debian/Dockerfile.dotnet8 create mode 100644 ci/base-images/cdxgen/debian/Dockerfile.dotnet9 create mode 100644 ci/base-images/debian/Dockerfile.dotnet6 create mode 100644 ci/base-images/debian/Dockerfile.dotnet8 create mode 100644 ci/base-images/debian/Dockerfile.dotnet9 create mode 100644 ci/base-images/debian/install.sh diff --git a/.github/workflows/build-base-images.yml b/.github/workflows/build-base-images.yml index 4671224b6..93b24b5a8 100644 --- a/.github/workflows/build-base-images.yml +++ b/.github/workflows/build-base-images.yml @@ -145,6 +145,83 @@ jobs: tags: ${{ steps.meta-cdxgen-dotnet.outputs.tags }} labels: ${{ steps.meta-cdxgen-dotnet.outputs.labels }} + debian-dotnet6-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-debian-dotnet6 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/debian-dotnet6 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ci/base-images/debian/Dockerfile.dotnet6 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta-debian-dotnet6.outputs.tags }} + labels: ${{ steps.meta-debian-dotnet6.outputs.labels }} + + cdxgen-debian-dotnet6-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + needs: debian-dotnet6-image + permissions: + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-cdxgen-debian-dotnet6 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/cdxgen-debian-dotnet6 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + if: github.ref == 'refs/heads/master' + with: + context: . + file: ci/base-images/cdxgen/debian/Dockerfile.dotnet6 + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/cyclonedx/cdxgen-debian-dotnet6:v11 + labels: ${{ steps.meta-cdxgen-debian-dotnet6.outputs.labels }} + sle-dotnet7-image: if: github.repository == 'CycloneDX/cdxgen' runs-on: ubuntu-latest @@ -321,6 +398,94 @@ jobs: tags: ${{ steps.meta-cdxgen-dotnet8.outputs.tags }} labels: ${{ steps.meta-cdxgen-dotnet8.outputs.labels }} + debian-dotnet8-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-debian-dotnet8 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/debian-dotnet8 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ci/base-images/debian/Dockerfile.dotnet8 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta-debian-dotnet8.outputs.tags }} + labels: ${{ steps.meta-debian-dotnet8.outputs.labels }} + + cdxgen-debian-dotnet8-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + needs: debian-dotnet8-image + permissions: + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-cdxgen-debian-dotnet8 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/cdxgen-debian-dotnet8 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + if: github.ref == 'refs/heads/master' + with: + context: . + file: ci/base-images/cdxgen/debian/Dockerfile.dotnet8 + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/cyclonedx/cdxgen-debian-dotnet8:v11 + labels: ${{ steps.meta-cdxgen-debian-dotnet8.outputs.labels }} + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + if: startsWith(github.ref, 'refs/tags/') + with: + context: . + file: ci/base-images/cdxgen/Dockerfile.dotnet8 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta-cdxgen-dotnet8.outputs.tags }} + labels: ${{ steps.meta-cdxgen-dotnet8.outputs.labels }} + sle-dotnet9-image: if: github.repository == 'CycloneDX/cdxgen' runs-on: ubuntu-latest @@ -409,6 +574,83 @@ jobs: tags: ${{ steps.meta-cdxgen-dotnet9.outputs.tags }} labels: ${{ steps.meta-cdxgen-dotnet9.outputs.labels }} + debian-dotnet9-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-debian-dotnet9 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/debian-dotnet9 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ci/base-images/debian/Dockerfile.dotnet9 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta-debian-dotnet9.outputs.tags }} + labels: ${{ steps.meta-debian-dotnet9.outputs.labels }} + + cdxgen-debian-dotnet9-image: + if: github.repository == 'CycloneDX/cdxgen' + runs-on: ubuntu-latest + needs: debian-dotnet8-image + permissions: + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-cdxgen-debian-dotnet9 + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/cyclonedx/cdxgen-debian-dotnet9 + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + if: github.ref == 'refs/heads/master' + with: + context: . + file: ci/base-images/cdxgen/debian/Dockerfile.dotnet9 + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/cyclonedx/cdxgen-debian-dotnet9:v11 + labels: ${{ steps.meta-cdxgen-debian-dotnet9.outputs.labels }} + sle-java-image: if: github.repository == 'CycloneDX/cdxgen' runs-on: ubuntu-latest diff --git a/ci/base-images/README.md b/ci/base-images/README.md index e388b0fb5..22634c071 100644 --- a/ci/base-images/README.md +++ b/ci/base-images/README.md @@ -54,6 +54,12 @@ Dotnet 3.1 or Dotnet 6.0 docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-dotnet6:v11 -r /app -o /app/bom.json -t dotnet ``` +Dotnet 3.1 or Dotnet 6.0 (debian) + +```shell +docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet6:v11 -r /app -o /app/bom.json -t dotnet +``` + Dotnet 7.0 ```shell @@ -66,6 +72,14 @@ Dotnet 8.0 docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-dotnet8:v11 -r /app -o /app/bom.json -t dotnet ``` +Dotnet 8.0 (debian) + +Use the debian version of the image in case of any crashes with the SLE version used by the image above. + +```shell +docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet8:v11 -r /app -o /app/bom.json -t dotnet +``` + Dotnet 9.0 Dotnet 9 is also bundled with the official `ghcr.io/cyclonedx/cdxgen` image. @@ -74,6 +88,12 @@ Dotnet 9 is also bundled with the official `ghcr.io/cyclonedx/cdxgen` image. docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-dotnet9:v11 -r /app -o /app/bom.json -t dotnet ``` +Dotnet 9.0 (debian) + +```shell +docker run --rm -e CDXGEN_DEBUG_MODE=debug -v /tmp:/tmp -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet9:v11 -r /app -o /app/bom.json -t dotnet +``` + ### Python applications Use the custom image `ghcr.io/cyclonedx/cdxgen-python312:v11` or `ghcr.io/cyclonedx/cdxgen-python311:v11`. This includes additional build tools and libraries to build a range of Python applications. Construction of the dependency tree is supported with Python >= 3.9. diff --git a/ci/base-images/cdxgen/Dockerfile.dotnet9 b/ci/base-images/cdxgen/Dockerfile.dotnet9 index 62b89f922..e8df7c772 100644 --- a/ci/base-images/cdxgen/Dockerfile.dotnet9 +++ b/ci/base-images/cdxgen/Dockerfile.dotnet9 @@ -8,7 +8,7 @@ LABEL maintainer="CycloneDX" \ org.opencontainers.image.vendor="AppThreat" \ org.opencontainers.image.licenses="Apache-2.0" \ org.opencontainers.image.title="cdxgen" \ - org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for dotnet 8 apps" \ + org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for dotnet 9 apps" \ org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-dotnet9:v11 -r /app --server" ENV CDXGEN_IN_CONTAINER=true \ diff --git a/ci/base-images/cdxgen/debian/Dockerfile.dotnet6 b/ci/base-images/cdxgen/debian/Dockerfile.dotnet6 new file mode 100644 index 000000000..d3bdb8d86 --- /dev/null +++ b/ci/base-images/cdxgen/debian/Dockerfile.dotnet6 @@ -0,0 +1,21 @@ +FROM ghcr.io/cyclonedx/debian-dotnet6:master + +LABEL maintainer="CycloneDX" \ + org.opencontainers.image.authors="Team AppThreat " \ + org.opencontainers.image.source="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.url="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.version="rolling" \ + org.opencontainers.image.vendor="AppThreat" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.title="cdxgen" \ + org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for dotnet 6 apps" \ + org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet6:v11 -r /app --server" + +ENV CDXGEN_IN_CONTAINER=true \ + PYTHONPATH=/opt/pypi +ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: + +RUN npm install -g @cyclonedx/cdxgen --omit=dev \ + && pip install --upgrade --no-cache-dir blint --target /opt/pypi + +ENTRYPOINT ["cdxgen"] diff --git a/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 b/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 new file mode 100644 index 000000000..61030cefa --- /dev/null +++ b/ci/base-images/cdxgen/debian/Dockerfile.dotnet8 @@ -0,0 +1,21 @@ +FROM ghcr.io/cyclonedx/debian-dotnet8:master + +LABEL maintainer="CycloneDX" \ + org.opencontainers.image.authors="Team AppThreat " \ + org.opencontainers.image.source="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.url="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.version="rolling" \ + org.opencontainers.image.vendor="AppThreat" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.title="cdxgen" \ + org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for dotnet 8 apps" \ + org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet8:v11 -r /app --server" + +ENV CDXGEN_IN_CONTAINER=true \ + PYTHONPATH=/opt/pypi +ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: + +RUN npm install -g @cyclonedx/cdxgen --omit=dev \ + && pip install --upgrade --no-cache-dir blint --target /opt/pypi + +ENTRYPOINT ["cdxgen"] diff --git a/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 b/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 new file mode 100644 index 000000000..d27ba4f7f --- /dev/null +++ b/ci/base-images/cdxgen/debian/Dockerfile.dotnet9 @@ -0,0 +1,21 @@ +FROM ghcr.io/cyclonedx/debian-dotnet9:master + +LABEL maintainer="CycloneDX" \ + org.opencontainers.image.authors="Team AppThreat " \ + org.opencontainers.image.source="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.url="https://github.com/CycloneDX/cdxgen" \ + org.opencontainers.image.version="rolling" \ + org.opencontainers.image.vendor="AppThreat" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.title="cdxgen" \ + org.opencontainers.image.description="Rolling image with cdxgen SBOM generator for dotnet 9 apps" \ + org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -p 9090:9090 -v $(pwd):/app:rw -t ghcr.io/cyclonedx/cdxgen-debian-dotnet9:v11 -r /app --server" + +ENV CDXGEN_IN_CONTAINER=true \ + PYTHONPATH=/opt/pypi +ENV PATH=${PATH}:/usr/local/bin:/opt/pypi/bin: + +RUN npm install -g @cyclonedx/cdxgen --omit=dev \ + && pip install --upgrade --no-cache-dir blint --target /opt/pypi + +ENTRYPOINT ["cdxgen"] diff --git a/ci/base-images/debian/Dockerfile.dotnet6 b/ci/base-images/debian/Dockerfile.dotnet6 new file mode 100644 index 000000000..c859a33ff --- /dev/null +++ b/ci/base-images/debian/Dockerfile.dotnet6 @@ -0,0 +1,37 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0-bookworm-slim + +ARG JAVA_VERSION=23.0.1-tem +ARG NODE_VERSION=22.12.0 + +ENV JAVA_VERSION=$JAVA_VERSION \ + JAVA_HOME="/opt/java/${JAVA_VERSION}" \ + DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ + DOTNET_NOLOGO=true \ + DOTNET_USE_POLLING_FILE_WATCHER=true \ + NUGET_XMLDOC_MODE=skip \ + DOTNET_RUNNING_IN_CONTAINER=true \ + DOTNET_CLI_TELEMETRY_OPTOUT=1 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + NVM_DIR="/root/.nvm" \ + npm_config_python=/usr/bin/python3.11 +ENV PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:/usr/local/bin:/root/.local/bin: + +COPY ci/base-images/debian/install.sh /tmp/ +COPY ci/base-images/nuget /usr/lib/mono/nuget + +RUN apt-get update && apt-get install -y --no-install-recommends curl bash bzip2 git-core zip unzip make gawk \ + && apt-get install -y build-essential mono-devel \ + && chmod +x /tmp/install.sh \ + && ./tmp/install.sh && rm /tmp/install.sh \ + && node -v \ + && npm -v \ + && dotnet --list-sdks \ + && echo -e '#!/bin/sh\nexec /usr/bin/mono /usr/lib/mono/nuget/nuget.exe "$@"\n' > /usr/bin/nuget \ + && chmod +x /usr/bin/nuget \ + && rm -rf /usr/lib/mono/nuget \ + && nuget --help \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* +CMD /bin/bash diff --git a/ci/base-images/debian/Dockerfile.dotnet8 b/ci/base-images/debian/Dockerfile.dotnet8 new file mode 100644 index 000000000..5d85bb545 --- /dev/null +++ b/ci/base-images/debian/Dockerfile.dotnet8 @@ -0,0 +1,33 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 + +ARG JAVA_VERSION=23.0.1-tem +ARG NODE_VERSION=23.5.0 + +ENV JAVA_VERSION=$JAVA_VERSION \ + JAVA_HOME="/opt/java/${JAVA_VERSION}" \ + DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ + DOTNET_NOLOGO=true \ + DOTNET_USE_POLLING_FILE_WATCHER=true \ + NUGET_XMLDOC_MODE=skip \ + DOTNET_RUNNING_IN_CONTAINER=true \ + DOTNET_CLI_TELEMETRY_OPTOUT=1 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + NVM_DIR="/root/.nvm" \ + npm_config_python=/usr/bin/python3.11 +ENV PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:/usr/local/bin:/root/.local/bin: + +COPY ci/base-images/debian/install.sh /tmp/ + +RUN apt-get update && apt-get install -y --no-install-recommends curl bash bzip2 git-core zip unzip make gawk \ + && apt-get install -y build-essential \ + && chmod +x /tmp/install.sh \ + && ./tmp/install.sh && rm /tmp/install.sh \ + && node -v \ + && npm -v \ + && dotnet --list-sdks \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* + +CMD /bin/bash diff --git a/ci/base-images/debian/Dockerfile.dotnet9 b/ci/base-images/debian/Dockerfile.dotnet9 new file mode 100644 index 000000000..2c9b640e7 --- /dev/null +++ b/ci/base-images/debian/Dockerfile.dotnet9 @@ -0,0 +1,33 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 + +ARG JAVA_VERSION=23.0.1-tem +ARG NODE_VERSION=23.5.0 + +ENV JAVA_VERSION=$JAVA_VERSION \ + JAVA_HOME="/opt/java/${JAVA_VERSION}" \ + DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ + DOTNET_NOLOGO=true \ + DOTNET_USE_POLLING_FILE_WATCHER=true \ + NUGET_XMLDOC_MODE=skip \ + DOTNET_RUNNING_IN_CONTAINER=true \ + DOTNET_CLI_TELEMETRY_OPTOUT=1 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + NVM_DIR="/root/.nvm" \ + npm_config_python=/usr/bin/python3.11 +ENV PATH=${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:/usr/local/bin:/root/.local/bin: + +COPY ci/base-images/debian/install.sh /tmp/ + +RUN apt-get update && apt-get install -y --no-install-recommends curl bash bzip2 git-core zip unzip make gawk \ + && apt-get install -y build-essential \ + && chmod +x /tmp/install.sh \ + && ./tmp/install.sh && rm /tmp/install.sh \ + && node -v \ + && npm -v \ + && dotnet --list-sdks \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* + +CMD /bin/bash diff --git a/ci/base-images/debian/install.sh b/ci/base-images/debian/install.sh new file mode 100644 index 000000000..4c1a3faca --- /dev/null +++ b/ci/base-images/debian/install.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +curl -s "https://get.sdkman.io" | bash +chmod +x /root/.sdkman/bin/sdkman-init.sh +source $HOME/.sdkman/bin/sdkman-init.sh +echo -e "sdkman_auto_answer=true\nsdkman_selfupdate_feature=false\nsdkman_auto_env=true\nsdkman_curl_connect_timeout=20\nsdkman_curl_max_time=0" >> $HOME/.sdkman/etc/config +if [ x"${JAVA_VERSION}" != "x" ]; then + sdk install java ${JAVA_VERSION} +fi +if [ x"${MAVEN_VERSION}" != "x" ]; then + sdk install maven ${MAVEN_VERSION} +fi +sdk offline enable +mv /root/.sdkman/candidates/* /opt/ +rm -rf /root/.sdkman +if [ x"${PYTHON_VERSION}" != "x" ]; then + python3 -m pip install --no-cache-dir --upgrade pip virtualenv + python3 -m pip install --no-cache-dir --upgrade --user pipenv poetry uv +fi +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +chmod +x /root/.nvm/nvm.sh +source /root/.nvm/nvm.sh +nvm install ${NODE_VERSION} diff --git a/ci/base-images/opensuse/Dockerfile.lang b/ci/base-images/opensuse/Dockerfile.lang index 1196c6421..c2dd0cee8 100644 --- a/ci/base-images/opensuse/Dockerfile.lang +++ b/ci/base-images/opensuse/Dockerfile.lang @@ -38,9 +38,9 @@ RUN set -e; \ ;; \ *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ esac \ - && zypper refresh && zypper --non-interactive update && zypper --non-interactive install -l --no-recommends gcc14 gcc14-c++ gcc14-fortran \ + && zypper refresh && zypper --non-interactive dup && zypper --non-interactive install -l --no-recommends gcc14 gcc14-c++ gcc14-fortran \ bzip2 python312 python312-devel python312-pip findutils java-23-openjdk-devel \ - libicu-devel gdal-devel git-core wget zip unzip make gawk nodejs22 npm22 rust1.81 cargo1.81 \ + libicu-devel git-core wget zip unzip make gawk nodejs22 npm22 rust1.81 cargo1.81 \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10 \ && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10 \ && update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 10 \ diff --git a/ci/base-images/opensuse/Dockerfile.python310 b/ci/base-images/opensuse/Dockerfile.python310 index 2135aa371..43f5a12cb 100644 --- a/ci/base-images/opensuse/Dockerfile.python310 +++ b/ci/base-images/opensuse/Dockerfile.python310 @@ -21,9 +21,9 @@ RUN set -e; \ ;; \ *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ esac \ - && zypper refresh && zypper --non-interactive update && zypper --non-interactive install -l --no-recommends gcc12 gcc12-c++ gcc12-fortran \ + && zypper refresh && zypper --non-interactive dup && zypper --non-interactive install -l --no-recommends gcc12 gcc12-c++ gcc12-fortran \ python310 python310-devel python310-pip findutils java-23-openjdk-devel \ - bzip2 git-core wget zip unzip make gawk nodejs22 npm22 nodejs22-devel gdal-devel libxml2-devel \ + bzip2 git-core wget zip unzip make gawk nodejs22 npm22 nodejs22-devel libxml2-devel \ && update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 10 \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 \ && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10 \ diff --git a/ci/base-images/opensuse/Dockerfile.python39 b/ci/base-images/opensuse/Dockerfile.python39 index 3c5598c03..c91d14856 100644 --- a/ci/base-images/opensuse/Dockerfile.python39 +++ b/ci/base-images/opensuse/Dockerfile.python39 @@ -21,9 +21,9 @@ RUN set -e; \ ;; \ *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ esac \ - && zypper refresh && zypper --non-interactive update && zypper --non-interactive install -l --no-recommends gcc12 gcc12-c++ gcc12-fortran \ + && zypper refresh && zypper --non-interactive dup && zypper --non-interactive install -l --no-recommends gcc12 gcc12-c++ gcc12-fortran \ python39 python39-devel python39-pip findutils java-23-openjdk-devel \ - bzip2 git-core wget zip unzip make gawk nodejs22 npm22 nodejs22-devel gdal-devel libxml2-devel \ + bzip2 git-core wget zip unzip make gawk nodejs22 npm22 nodejs22-devel libxml2-devel \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 \ && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10 \ && update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-12 10 \