From cf133d06dd685db8cfe66117200a9abe988586f6 Mon Sep 17 00:00:00 2001 From: Ilolm Date: Sat, 9 Nov 2024 12:51:57 +0200 Subject: [PATCH] Resolved hadolint build issues --- debian/bookworm-slim/hotspot/Dockerfile | 30 ++++++++++++------------- debian/bookworm/hotspot/Dockerfile | 30 ++++++++++++------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/debian/bookworm-slim/hotspot/Dockerfile b/debian/bookworm-slim/hotspot/Dockerfile index 234aad51ce..c3b6f1833f 100644 --- a/debian/bookworm-slim/hotspot/Dockerfile +++ b/debian/bookworm-slim/hotspot/Dockerfile @@ -58,7 +58,7 @@ FROM debian:bookworm-"${BOOKWORM_TAG}"-slim AS controller # jenkins version being bundled in this docker image # #----------------------------------------------------# ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} +ENV JENKINS_VERSION="${JENKINS_VERSION:-2.479}" ARG TARGETARCH \ COMMIT_SHA @@ -125,26 +125,26 @@ ARG user=jenkins \ JENKINS_HOME=/var/jenkins_home \ REF=/usr/share/jenkins/ref -ENV JENKINS_HOME=$JENKINS_HOME \ - JENKINS_SLAVE_AGENT_PORT=${agent_port} \ - REF=$REF +ENV JENKINS_HOME="$JENKINS_HOME" \ + JENKINS_SLAVE_AGENT_PORT="${agent_port}" \ + REF="$REF" #---------------------------------------------------------------# # Jenkins is run with user `jenkins`, uid = 1000 # # If you bind mount a volume from the host or a data container, # # ensure you use the same uid(e.g. 1000) # #---------------------------------------------------------------# -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} +RUN mkdir -p "$JENKINS_HOME" \ + && chown '${uid}':'${gid}' "$JENKINS_HOME" \ + && groupadd -g '${gid}' '${group}' \ + && useradd -d "$JENKINS_HOME" -u '${uid}' -g '${gid}' -l -m -s /bin/bash '${user}' #-----------------------------------------------------------------------------------# # $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration # # we want to set on a fresh new installation. Use it to bundle additional plugins # # or config file with your custom jenkins Docker image. # #-----------------------------------------------------------------------------------# -RUN mkdir -p ${REF}/init.groovy.d +RUN mkdir -p "${REF}"/init.groovy.d #------------------------------------------------------------------------# # JENKINS_SHA: jenkins.war checksum, download will be validated using it # @@ -158,7 +158,7 @@ ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # could use ADD but this one does not check Last-Modified header neither does it allow to control checksum # # see https://github.com/docker/docker/issues/8331 # #----------------------------------------------------------------------------------------------------------# -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ +RUN curl -fsSL "${JENKINS_URL}" -o /usr/share/jenkins/jenkins.war \ && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ && sha256sum -c --strict /tmp/jenkins_sha \ && rm -f /tmp/jenkins_sha @@ -166,16 +166,16 @@ RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ ENV JENKINS_UC=https://updates.jenkins.io \ JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental \ JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" +RUN chown -R '${user}' "$JENKINS_HOME" "$REF" ARG PLUGIN_CLI_VERSION=2.13.2 \ - PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ + PLUGIN_CLI_URL="https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar" +RUN curl -fsSL "${PLUGIN_CLI_URL}" -o /opt/jenkins-plugin-manager.jar \ + && echo "$(curl -fsSL ${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ && sha256sum -c --strict /tmp/jenkins_sha \ && rm -f /tmp/jenkins_sha -ENV COPY_REFERENCE_FILE_LOG=$JENKINS_HOME/copy_reference_file.log \ +ENV COPY_REFERENCE_FILE_LOG="$JENKINS_HOME/copy_reference_file.log" \ JAVA_HOME=/opt/java/openjdk ENV PATH="${JAVA_HOME}/bin:${PATH}" diff --git a/debian/bookworm/hotspot/Dockerfile b/debian/bookworm/hotspot/Dockerfile index ce444eda91..eaf5028600 100644 --- a/debian/bookworm/hotspot/Dockerfile +++ b/debian/bookworm/hotspot/Dockerfile @@ -58,7 +58,7 @@ FROM debian:bookworm-"${BOOKWORM_TAG}" AS controller # jenkins version being bundled in this docker image # #----------------------------------------------------# ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} +ENV JENKINS_VERSION="${JENKINS_VERSION:-2.479}" ARG TARGETARCH \ COMMIT_SHA @@ -125,26 +125,26 @@ ARG user=jenkins \ JENKINS_HOME=/var/jenkins_home \ REF=/usr/share/jenkins/ref -ENV JENKINS_HOME=$JENKINS_HOME \ - JENKINS_SLAVE_AGENT_PORT=${agent_port} \ - REF=$REF +ENV JENKINS_HOME="$JENKINS_HOME" \ + JENKINS_SLAVE_AGENT_PORT="${agent_port}" \ + REF="$REF" #---------------------------------------------------------------# # Jenkins is run with user `jenkins`, uid = 1000 # # If you bind mount a volume from the host or a data container, # # ensure you use the same uid(e.g. 1000) # #---------------------------------------------------------------# -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} +RUN mkdir -p "$JENKINS_HOME" \ + && chown '${uid}':'${gid}' "$JENKINS_HOME" \ + && groupadd -g '${gid}' '${group}' \ + && useradd -d "$JENKINS_HOME" -u '${uid}' -g '${gid}' -l -m -s /bin/bash '${user}' #-----------------------------------------------------------------------------------# # $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration # # we want to set on a fresh new installation. Use it to bundle additional plugins # # or config file with your custom jenkins Docker image. # #-----------------------------------------------------------------------------------# -RUN mkdir -p ${REF}/init.groovy.d +RUN mkdir -p "${REF}"/init.groovy.d #------------------------------------------------------------------------# # JENKINS_SHA: jenkins.war checksum, download will be validated using it # @@ -158,7 +158,7 @@ ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # could use ADD but this one does not check Last-Modified header neither does it allow to control checksum # # see https://github.com/docker/docker/issues/8331 # #----------------------------------------------------------------------------------------------------------# -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ +RUN curl -fsSL "${JENKINS_URL}" -o /usr/share/jenkins/jenkins.war \ && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ && sha256sum -c --strict /tmp/jenkins_sha \ && rm -f /tmp/jenkins_sha @@ -166,16 +166,16 @@ RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ ENV JENKINS_UC=https://updates.jenkins.io \ JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental \ JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" +RUN chown -R '${user}' "$JENKINS_HOME" "$REF" ARG PLUGIN_CLI_VERSION=2.13.2 \ - PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ + PLUGIN_CLI_URL="https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar" +RUN curl -fsSL "${PLUGIN_CLI_URL}" -o /opt/jenkins-plugin-manager.jar \ + && echo "$(curl -fsSL ${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ && sha256sum -c --strict /tmp/jenkins_sha \ && rm -f /tmp/jenkins_sha -ENV COPY_REFERENCE_FILE_LOG=$JENKINS_HOME/copy_reference_file.log \ +ENV COPY_REFERENCE_FILE_LOG="$JENKINS_HOME/copy_reference_file.log" \ JAVA_HOME=/opt/java/openjdk ENV PATH="${JAVA_HOME}/bin:${PATH}"