Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 2384 switch to Temurin Java #2641

Merged
merged 7 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-client-server-pds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ permissions:

env:
ACTIONS_BASE_IMAGE_ALPINE: alpine:3.17
ACTIONS_BASE_IMAGE_DEBIAN: debian:testing-slim
ACTIONS_BASE_IMAGE_DEBIAN: debian:12-slim
ACTIONS_SECHUB_REGISTRY: ghcr.io/mercedes-benz/sechub
ACTIONS_HELM_REGISTRY: "oci://ghcr.io/mercedes-benz/sechub/helm-charts"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG BUILD_TYPE
ARG CHECKMARX_WRAPPER_VERSION=1.1.0

# The base image of the builder
ARG BUILDER_BASE_IMAGE="debian:testing-slim"
ARG BUILDER_BASE_IMAGE="debian:12-slim"

# Artifact folder
ARG ARTIFACT_FOLDER="/artifacts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ USER root
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get --assume-yes upgrade && \
apt-get --assume-yes install dos2unix unzip wget openjdk-17-jre-headless libxml2-utils && \
apt-get --assume-yes install dos2unix unzip wget libxml2-utils && \
apt-get --assume-yes clean

# Install FindSecurityBugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ COPY pds-config.json "$PDS_FOLDER/pds-config.json"
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get upgrade --assume-yes && \
apt-get install --assume-yes openjdk-17-jre firefox-esr wget && \
apt-get install --assume-yes firefox-esr wget && \
apt-get clean

# Install ZAP
Expand Down
7 changes: 6 additions & 1 deletion sechub-pds-solutions/pds-base/10-create-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ VERSION="$2"
PDS_VERSION="$3"
BASE_IMAGE="$4" # optional
BUILD_TYPE="$5" # optional
DEFAULT_BASE_IMAGE="debian:testing-slim"
DEFAULT_BASE_IMAGE="debian:12-slim"
DEFAULT_BUILD_TYPE="download"

cd `dirname $0`

usage() {
cat - <<EOF
usage: $0 <docker registry> <version tag> <pds version>
Expand Down Expand Up @@ -59,6 +61,9 @@ echo ">> Build type: $BUILD_TYPE"
BUILD_ARGS+=" --build-arg PDS_VERSION=$PDS_VERSION"
echo ">> SecHub PDS release version: $PDS_VERSION"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
# nesessary for switching between build stages
export BUILDKIT_PROGRESS=plain
Expand Down
3 changes: 3 additions & 0 deletions sechub-pds-solutions/pds-base/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# install-java/ is copied by the build scripts from ../../../sechub-solutions-shared/
# so we exclude it here from git
install-java/
21 changes: 18 additions & 3 deletions sechub-pds-solutions/pds-base/docker/PDS-Debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ARG PDS_VERSION
ARG BUILD_TYPE
ARG GO="go1.20.4.linux-amd64.tar.gz"

# possible values: temurin, openj9, openjdk
ARG JAVA_DISTRIBUTION="temurin"
# possible values: 17
ARG JAVA_VERSION="17"

Expand Down Expand Up @@ -42,7 +44,7 @@ RUN mkdir --parent "$PDS_ARTIFACT_FOLDER" "$DOWNLOAD_FOLDER"
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get upgrade --assume-yes --quiet && \
apt-get install --quiet --assume-yes wget w3m git "openjdk-$JAVA_VERSION-jdk-headless" && \
apt-get install --quiet --assume-yes wget w3m git && \
apt-get clean

# Install Go
Expand All @@ -60,6 +62,12 @@ RUN cd "$DOWNLOAD_FOLDER" && \
# remove go tar.gz
rm "$GO"

COPY --chmod=755 install-java/debian "$DOWNLOAD_FOLDER/install-java/"

# Install Java
RUN cd "$DOWNLOAD_FOLDER/install-java/" && \
./install-java.sh "$JAVA_DISTRIBUTION" "$JAVA_VERSION" jdk

# Copy clone script
COPY --chmod=755 clone.sh "$BUILD_FOLDER/clone.sh"

Expand Down Expand Up @@ -134,8 +142,9 @@ LABEL org.opencontainers.image.title="SecHub PDS Base Image"
LABEL org.opencontainers.image.description="The base image for the SecHub Product Delegation Server (PDS)"
LABEL maintainer="SecHub FOSS Team"

ARG PDS_ARTIFACT_FOLDER
ARG JAVA_DISTRIBUTION
ARG JAVA_VERSION
ARG PDS_ARTIFACT_FOLDER
ARG PDS_VERSION

# env vars in container
Expand Down Expand Up @@ -169,9 +178,15 @@ COPY --from=builder "$PDS_ARTIFACT_FOLDER" "$PDS_FOLDER"
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get upgrade --assume-yes --quiet && \
apt-get install --assume-yes --quiet "openjdk-$JAVA_VERSION-jre-headless" tree && \
apt-get install --assume-yes --quiet tree && \
apt-get clean

COPY --chmod=755 install-java/debian "$DOWNLOAD_FOLDER/install-java/"

# Install Java
RUN cd "$DOWNLOAD_FOLDER/install-java/" && \
./install-java.sh "$JAVA_DISTRIBUTION" "$JAVA_VERSION" jre

# Copy run script into the container
COPY run.sh /run.sh

Expand Down
2 changes: 1 addition & 1 deletion sechub-pds-solutions/pds-base/env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
BASE_IMAGE=debian:testing-slim
BASE_IMAGE=debian:12-slim

# Resource limits
MEMORY_LIMIT=300M
Expand Down
2 changes: 1 addition & 1 deletion sechub-pds-solutions/pmd/docker-compose_pds_pmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
pds-pmd:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
context: docker/
dockerfile: PMD-Debian.dockerfile
container_name: pds-pmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
pds-pmd:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
context: docker/
dockerfile: PMD-Debian.dockerfile
env_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
pds-pmd:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
context: docker/
dockerfile: PMD-Debian.dockerfile
env_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
pds-pmd:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
context: docker/
dockerfile: PMD-Debian.dockerfile
container_name: pds-pmd
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/01-start-single-docker-compose-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ source ../sechub-solutions-shared/scripts/9999-env-file-helper.sh
setup_environment_file ".env" "env"
setup_environment_file "$ENVIRONMENT_FILE" "env-sechub"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/01-start-single-docker-compose-fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ source ../sechub-solutions-shared/scripts/9999-env-file-helper.sh
setup_environment_file ".env" "env"
setup_environment_file "$ENVIRONMENT_FILE" "env-sechub"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/01-start-single-docker-compose-rocky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ source ../sechub-solutions-shared/scripts/9999-env-file-helper.sh
setup_environment_file ".env" "env"
setup_environment_file "$ENVIRONMENT_FILE" "env-sechub"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/01-start-single-docker-compose-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ source ../sechub-solutions-shared/scripts/9999-env-file-helper.sh
setup_environment_file ".env" "env"
setup_environment_file "$ENVIRONMENT_FILE" "env-sechub"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/01-start-single-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ source ../sechub-solutions-shared/scripts/9999-env-file-helper.sh
setup_environment_file ".env" "env"
setup_environment_file "$ENVIRONMENT_FILE" "env-sechub"

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Use Docker BuildKit
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/10-create-image-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ if [ -n "$SECHUB_SERVER_VERSION" ] ; then
echo " from released version: v${SECHUB_SERVER_VERSION}-server"
fi

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Docker BuildKit settings
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/10-create-image-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Building SecHub server image
based on image: $BASE_IMAGE
EOF

echo "Copying install-java scripts into the docker directory"
cp --recursive --force ../sechub-solutions-shared/install-java/ docker/

# Docker BuildKit settings
export BUILDKIT_PROGRESS=plain
export DOCKER_BUILDKIT=1
Expand Down
2 changes: 1 addition & 1 deletion sechub-solution/docker-compose_sechub-debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion sechub-solution/docker-compose_sechub_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
sechub:
build:
args:
- BASE_IMAGE=debian:testing-slim
- BASE_IMAGE=debian:12-slim
- BUILD_TYPE=${BUILD_TYPE}
- JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}
- JAVA_VERSION=${JAVA_VERSION}
Expand Down
3 changes: 3 additions & 0 deletions sechub-solution/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# install-java/ is copied by the build scripts from ../../sechub-solutions-shared/
# so we exclude it here from git
install-java/
2 changes: 1 addition & 1 deletion sechub-solution/docker/SecHub-Alpine.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ARG TAG=""
ARG BRANCH=""

# possible values: temurin, openj9, openjdk
ARG JAVA_DISTRIBUTION="openjdk"
ARG JAVA_DISTRIBUTION="temurin"

# possible values: 17
ARG JAVA_VERSION="17"
Expand Down
2 changes: 1 addition & 1 deletion sechub-solution/docker/SecHub-Debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARG BRANCH=""
ARG GO="go1.20.4.linux-${TARGETARCH}.tar.gz"

# possible values: temurin, openj9, openjdk
ARG JAVA_DISTRIBUTION="openjdk"
ARG JAVA_DISTRIBUTION="temurin"
# possible values: 17
ARG JAVA_VERSION="17"

Expand Down
4 changes: 2 additions & 2 deletions sechub-solution/docker/SecHub-Fedora.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ARG BASE_IMAGE

# Inject the target architecture
# For more information:
# For more information:
# - https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETARCH

Expand All @@ -20,7 +20,7 @@ ARG TAG=""
ARG BRANCH=""

# possible values: temurin, openj9, openjdk
ARG JAVA_DISTRIBUTION="openjdk"
ARG JAVA_DISTRIBUTION="temurin"
# possible values: 17
ARG JAVA_VERSION="17"

Expand Down
2 changes: 1 addition & 1 deletion sechub-solution/docker/SecHub-Rocky.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARG BRANCH=""
ARG GO="go1.20.4.linux-${TARGETARCH}.tar.gz"

# possible values: temurin, openj9, openjdk
ARG JAVA_DISTRIBUTION="openjdk"
ARG JAVA_DISTRIBUTION="temurin"
# possible values: 17
ARG JAVA_VERSION="17"

Expand Down
2 changes: 1 addition & 1 deletion sechub-solution/env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SECHUB_VERSION="1.2.0"
GO="go1.20.4.linux-amd64.tar.gz"

# possible values: temurin, openj9, openjdk
JAVA_DISTRIBUTION="openjdk"
JAVA_DISTRIBUTION="temurin"

# Which Java version to use
# Not all Java versions are available
Expand Down
Loading