You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/02/27 17:38:59 UTC

[airflow] branch master updated: Update hadolint from v1.18.0 to v1.22.1 (#14509)

This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new cc7260a  Update hadolint from v1.18.0 to v1.22.1 (#14509)
cc7260a is described below

commit cc7260a9e8b421fa4193ec7cd32d928b9275f302
Author: Kamil Breguła <mi...@users.noreply.github.com>
AuthorDate: Sat Feb 27 18:38:43 2021 +0100

    Update hadolint from v1.18.0 to v1.22.1 (#14509)
    
    * Update hadolint from v1.22.1 to v1.18.0
    
    * fixup! Update hadolint from v1.22.1 to v1.18.0
    
    * fixup! fixup! Update hadolint from v1.22.1 to v1.18.0
    
    Co-authored-by: Kamil Breguła <ka...@apache.org>
---
 .pre-commit-config.yaml                           |  1 +
 Dockerfile                                        |  4 ++--
 Dockerfile.ci                                     |  4 ++--
 scripts/ci/dockerfiles/krb5-kdc-server/Dockerfile | 18 ++++++++++--------
 scripts/ci/static_checks/lint_dockerfile.sh       |  5 +++--
 5 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 248ed6f..37b505a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -233,6 +233,7 @@ repos:
         entry: "./scripts/ci/pre_commit/pre_commit_lint_dockerfile.sh"
         files: Dockerfile.*$
         pass_filenames: true
+        require_serial: true
       - id: setup-order
         name: Check order of dependencies in setup.py and setup.cfg
         language: python
diff --git a/Dockerfile b/Dockerfile
index 807f4bf..c1c8560 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -190,7 +190,7 @@ ENV AIRFLOW_INSTALL_USER_FLAG="--user"
 ENV AIRFLOW_INSTALL_EDITABLE_FLAG=""
 
 # Upgrade to specific PIP version
-RUN pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"
+RUN pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
 
 # By default we do not use pre-cached packages, but in CI/Breeze environment we override this to speed up
 # builds in case setup.py/setup.cfg changed. This is pure optimisation of CI/Breeze builds.
@@ -471,7 +471,7 @@ COPY --chown=airflow:root scripts/in_container/prod/entrypoint_prod.sh /entrypoi
 COPY --chown=airflow:root scripts/in_container/prod/clean-logs.sh /clean-logs
 RUN chmod a+x /entrypoint /clean-logs
 
-RUN pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"
+RUN pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
 
 # Make /etc/passwd root-group-writeable so that user can be dynamically added by OpenShift
 # See https://github.com/apache/airflow/issues/9248
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 80bf342..0231196 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -290,7 +290,7 @@ RUN echo "Pip no cache dir: ${PIP_NO_CACHE_DIR}"
 ARG PIP_PROGRESS_BAR="on"
 ENV PIP_PROGRESS_BAR=${PIP_PROGRESS_BAR}
 
-RUN pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"
+RUN pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
 
 # Only copy install_airflow_from_latest_master.sh to not invalidate cache on other script changes
 COPY scripts/docker/install_airflow_from_latest_master.sh /scripts/docker/install_airflow_from_latest_master.sh
@@ -413,7 +413,7 @@ RUN SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]') \
 ARG ADDITIONAL_PYTHON_DEPS=""
 
 RUN if [[ -n "${ADDITIONAL_PYTHON_DEPS}" ]]; then \
-        pip install ${ADDITIONAL_PYTHON_DEPS}; \
+        pip install --no-cache-dir ${ADDITIONAL_PYTHON_DEPS}; \
     fi
 
 WORKDIR ${AIRFLOW_SOURCES}
diff --git a/scripts/ci/dockerfiles/krb5-kdc-server/Dockerfile b/scripts/ci/dockerfiles/krb5-kdc-server/Dockerfile
index 118b4db..e3c906d 100644
--- a/scripts/ci/dockerfiles/krb5-kdc-server/Dockerfile
+++ b/scripts/ci/dockerfiles/krb5-kdc-server/Dockerfile
@@ -24,7 +24,8 @@ FROM centos:7
 WORKDIR /root/
 
 # Dev stuff
-RUN yum -y install curl wget
+# hadolint ignore=DL3033
+RUN yum -y install curl wget && yum clean all
 
 # python
 RUN curl "https://bootstrap.pypa.io/get-pip.py" -o /tmp/get-pip.py && \
@@ -32,11 +33,12 @@ RUN curl "https://bootstrap.pypa.io/get-pip.py" -o /tmp/get-pip.py && \
     rm /tmp/get-pip.py
 
 # supervisord
-RUN pip install supervisor==3.3.3 && \
+RUN pip install --no-cache-dir supervisor==3.3.3 && \
     mkdir -p /var/log/supervisord/
 
 # kerberos server
-RUN yum -y install ntp krb5-server krb5-libs
+# hadolint ignore=DL3033
+RUN yum -y install ntp krb5-server krb5-libs && yum clean all
 
 # kerberos server configuration
 ENV KRB5_CONFIG=/etc/krb5.conf
@@ -61,11 +63,11 @@ COPY supervisord.conf /etc/supervisord.conf
 COPY entrypoint.sh /entrypoint.sh
 ENTRYPOINT ["/entrypoint.sh"]
 
-LABEL org.apache.airflow.component="krb5-kdc-server"
-LABEL org.apache.airflow.krb5-kdc-server.core.version="krb5"
-LABEL org.apache.airflow.airflow_bats.version="${AIRFLOW_KRB5KDCSERVER_VERSION}"
-LABEL org.apache.airflow.commit_sha="${COMMIT_SHA}"
-LABEL maintainer="Apache Airflow Community <de...@airflow.apache.org>"
+LABEL org.apache.airflow.component="krb5-kdc-server" \
+    org.apache.airflow.krb5-kdc-server.core.version="krb5" \
+    org.apache.airflow.airflow_bats.version="${AIRFLOW_KRB5KDCSERVER_VERSION}" \
+    org.apache.airflow.commit_sha="${COMMIT_SHA}" \
+    maintainer="Apache Airflow Community <de...@airflow.apache.org>"
 
 # when container is starting
 CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
diff --git a/scripts/ci/static_checks/lint_dockerfile.sh b/scripts/ci/static_checks/lint_dockerfile.sh
index f22005d..491662d 100755
--- a/scripts/ci/static_checks/lint_dockerfile.sh
+++ b/scripts/ci/static_checks/lint_dockerfile.sh
@@ -19,6 +19,7 @@
 . "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
 
 function run_docker_lint() {
+    IMAGE_NAME="hadolint/hadolint:v1.22.1-8-gf0ef28b-alpine"
     if [[ "${#@}" == "0" ]]; then
         echo
         echo "Running docker lint for all Dockerfiles"
@@ -28,7 +29,7 @@ function run_docker_lint() {
             -v "$(pwd):/root" \
             -w "/root" \
             --rm \
-           "hadolint/hadolint:v1.18.0-6-ga0d655d-debian" "/bin/hadolint" $(git ls-files| grep 'Dockerfile')
+           "${IMAGE_NAME}" "/bin/hadolint" $(git ls-files| grep 'Dockerfile')
         echo
         echo "Hadolint completed with no errors"
         echo
@@ -40,7 +41,7 @@ function run_docker_lint() {
             -v "$(pwd):/root" \
             -w "/root" \
             --rm \
-             "hadolint/hadolint:v1.18.0-6-ga0d655d-debian" "/bin/hadolint" "${@}"
+            "${IMAGE_NAME}" "/bin/hadolint" "${@}"
         echo
         echo "Hadolint completed with no errors"
         echo