Jenkins/Docker: Update hadolint version.
- Ignore hadolint warnings about not pinned version.
diff --git a/Jenkinsfile b/Jenkinsfile
index d54a315..8e2ef73 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -19,6 +19,7 @@
'label': 'latest'
]
]
+HADOLINT_VERSION = '2.6.0-alpine'
dockerinfo = DOCKERINFO['production']
@@ -135,9 +136,7 @@
echo "VERSION: '${VERSION}'"
}
- dir('docker') {
- stash name: 'dockerfile', includes: '**'
- }
+ stash name: 'dockerfile', includes: 'docker/**'
}
}
@@ -206,7 +205,7 @@
runAsGroup: 1000
containers:
- name: hadolint
- image: mcu--docker.eu-west-1.artifactory.aws.arm.com/hadolint/hadolint:v1.19.0-alpine
+ image: mcu--docker.eu-west-1.artifactory.aws.arm.com/hadolint/hadolint:${HADOLINT_VERSION}
alwaysPullImage: true
imagePullPolicy: Always
command:
@@ -221,15 +220,13 @@
}
}
steps {
- dir('docker') {
- unstash 'dockerfile'
+ unstash 'dockerfile'
- sh 'hadolint --format json dockerfile | tee hadolint.log'
+ sh 'hadolint --format json docker/dockerfile* | tee hadolint.log'
- recordIssues tools: [hadoLint(id: 'hadolint', pattern: 'hadolint.log')],
- qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
- referenceJobName: 'nightly', ignoreQualityGate: true
- }
+ recordIssues tools: [hadoLint(id: 'hadolint', pattern: 'hadolint.log')],
+ qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
+ referenceJobName: 'nightly', ignoreQualityGate: true
}
}
@@ -265,9 +262,9 @@
steps {
sh('apk add bash curl git')
script {
- dir('docker') {
- unstash 'dockerfile'
+ unstash 'dockerfile'
+ dir('docker') {
dockerinfo = DOCKERINFO['staging']
withCredentials([sshUserPrivateKey(credentialsId: 'grasci_with_pk',
keyFileVariable: 'grasciPk',
diff --git a/docker/dockerfile b/docker/dockerfile
index 6b6013e..bc7ed21 100644
--- a/docker/dockerfile
+++ b/docker/dockerfile
@@ -10,6 +10,7 @@
# install packages from official Ubuntu repo
ENV DEBIAN_FRONTEND=noninteractive
+# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bc \
@@ -84,6 +85,7 @@
# install Python requirements
COPY requirements.txt ${INSTALLER_PATH}/
+# hadolint ignore=DL3013
RUN python3 -m pip install -U --no-cache-dir pip && \
python3 -m pip install -U --no-cache-dir -r ${INSTALLER_PATH}/requirements.txt
diff --git a/docker/dockerfile.gnu b/docker/dockerfile.gnu
index dee7f4a..9c8e13e 100644
--- a/docker/dockerfile.gnu
+++ b/docker/dockerfile.gnu
@@ -6,6 +6,7 @@
# install packages from official Ubuntu repo
ENV DEBIAN_FRONTEND=noninteractive
+# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bc \
@@ -48,6 +49,7 @@
# install Python requirements
COPY requirements.txt ${INSTALLER_PATH}/
+# hadolint ignore=DL3013
RUN python3 -m pip install -U --no-cache-dir pip && \
python3 -m pip install -U --no-cache-dir -r ${INSTALLER_PATH}/requirements.txt