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

HADOOP-18449. Upgrade hadolint to 2.10.0 #4876

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions .hadolint.yaml
@@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ignored:
- DL3059
2 changes: 1 addition & 1 deletion dev-support/docker/Dockerfile
Expand Up @@ -86,7 +86,7 @@ RUN pkg-resolver/install-common-pkgs.sh
RUN pkg-resolver/install-spotbugs.sh ubuntu:focal
RUN pkg-resolver/install-boost.sh ubuntu:focal
RUN pkg-resolver/install-protobuf.sh ubuntu:focal
RUN pkg-resolver/install-hadolint.sh ubuntu:focal
RUN pkg-resolver/install-hadolint.sh ubuntu:focal 2.10.0
RUN pkg-resolver/install-intel-isa-l.sh ubuntu:focal

###
Expand Down
6 changes: 4 additions & 2 deletions dev-support/docker/Dockerfile_centos_7
Expand Up @@ -33,13 +33,14 @@ RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
######
# Install packages from yum
######
# hadolint ignore=DL3008,SC2046
# hadolint ignore=DL3008,SC2046,DL3033
RUN yum update -y \
&& yum groupinstall -y "Development Tools" \
&& yum install -y \
centos-release-scl \
python3 \
&& yum install -y $(pkg-resolver/resolve.py centos:7)
&& yum install -y $(pkg-resolver/resolve.py centos:7) \
&& yum clean all

# Set GCC 9 as the default C/C++ compiler
RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
Expand Down Expand Up @@ -93,4 +94,5 @@ RUN pkg-resolver/install-boost.sh centos:7
RUN pkg-resolver/install-spotbugs.sh centos:7
RUN pkg-resolver/install-nodejs.sh centos:7
RUN pkg-resolver/install-git.sh centos:7
RUN pkg-resolver/install-hadolint.sh centos:7 2.10.0
RUN pkg-resolver/install-common-pkgs.sh
21 changes: 12 additions & 9 deletions dev-support/docker/Dockerfile_centos_8
Expand Up @@ -40,26 +40,28 @@ RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:8
######
# Install packages from yum
######
# hadolint ignore=DL3008,SC2046
# hadolint ignore=DL3008,SC2046,DL3033
RUN yum update -y \
&& yum install -y python3 \
&& yum install -y $(pkg-resolver/resolve.py centos:8)
&& yum install -y $(pkg-resolver/resolve.py centos:8) \
&& yum clean all

####
# Install EPEL
####
RUN pkg-resolver/install-epel.sh centos:8

# hadolint ignore=DL3033,DL3041
RUN dnf --enablerepo=powertools install -y \
doxygen \
snappy-devel \
yasm

RUN dnf install -y \
bouncycastle \
gcc-toolset-9-gcc \
gcc-toolset-9-gcc-c++ \
libpmem-devel
yasm \
&& dnf install -y \
bouncycastle \
gcc-toolset-9-gcc \
gcc-toolset-9-gcc-c++ \
libpmem-devel \
&& dnf clean all

# Set GCC 9 as the default C/C++ compiler
RUN echo "source /opt/rh/gcc-toolset-9/enable" >> /etc/bashrc
Expand Down Expand Up @@ -115,4 +117,5 @@ RUN pkg-resolver/install-boost.sh centos:8
RUN pkg-resolver/install-spotbugs.sh centos:8
RUN pkg-resolver/install-protobuf.sh centos:8
RUN pkg-resolver/install-zstandard.sh centos:8
RUN pkg-resolver/install-hadolint.sh centos:8 2.10.0
RUN pkg-resolver/install-common-pkgs.sh
2 changes: 1 addition & 1 deletion dev-support/docker/Dockerfile_debian_10
Expand Up @@ -86,7 +86,7 @@ RUN pkg-resolver/install-cmake.sh debian:10
RUN pkg-resolver/install-spotbugs.sh debian:10
RUN pkg-resolver/install-boost.sh debian:10
RUN pkg-resolver/install-protobuf.sh debian:10
RUN pkg-resolver/install-hadolint.sh debian:10
RUN pkg-resolver/install-hadolint.sh debian:10 2.10.0
RUN pkg-resolver/install-intel-isa-l.sh debian:10

###
Expand Down
27 changes: 21 additions & 6 deletions dev-support/docker/pkg-resolver/install-hadolint.sh
Expand Up @@ -27,9 +27,24 @@ if [ $? -eq 1 ]; then
exit 1
fi

curl -L -s -S \
https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
-o /bin/hadolint &&
chmod a+rx /bin/hadolint &&
shasum -a 512 /bin/hadolint |
awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
default_version="1.11.1"
version_to_install=$default_version
if [ -n "$2" ]; then
version_to_install="$2"
fi

if [ "$version_to_install" == "1.11.1" ]; then
curl -L -s -S \
https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
-o /bin/hadolint &&
chmod a+rx /bin/hadolint &&
shasum -a 512 /bin/hadolint |
awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
elif [ "$version_to_install" == "2.10.0" ]; then
curl -L -s -S \
https://github.com/hadolint/hadolint/releases/download/v2.10.0/hadolint-Linux-x86_64 \
-o /bin/hadolint &&
chmod a+rx /bin/hadolint &&
shasum -a 512 /bin/hadolint |
awk '$1!="4816c95243bedf15476d2225f487fc17465495fb2031e1a4797d82a26db83a1edb63e4fed084b80cef17d5eb67eb45508caadaf7cd0252fb061187113991a338" {exit(1)}'
fi