Skip to content

Commit

Permalink
Resolved hadolint build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ilolm committed Nov 9, 2024
1 parent c2eb3f8 commit cf133d0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
30 changes: 15 additions & 15 deletions debian/bookworm-slim/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 #
Expand All @@ -158,24 +158,24 @@ 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

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}"
Expand Down
30 changes: 15 additions & 15 deletions debian/bookworm/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 #
Expand All @@ -158,24 +158,24 @@ 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

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}"
Expand Down

0 comments on commit cf133d0

Please sign in to comment.