diff --git a/images/airflow/2.10.1/Dockerfile.base.j2 b/images/airflow/2.10.1/Dockerfile.base.j2 index b1fba00..3346905 100644 --- a/images/airflow/2.10.1/Dockerfile.base.j2 +++ b/images/airflow/2.10.1/Dockerfile.base.j2 @@ -31,6 +31,12 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c + ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.10.1/Dockerfile.derivatives.j2 b/images/airflow/2.10.1/Dockerfile.derivatives.j2 index 0d9d5b1..9cc432e 100644 --- a/images/airflow/2.10.1/Dockerfile.derivatives.j2 +++ b/images/airflow/2.10.1/Dockerfile.derivatives.j2 @@ -30,7 +30,7 @@ RUN rm -rf /bootstrap-dev {# This is the standard build type. it is what customer uses.#} USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell {% elif build_type == 'explorer' %} @@ -42,7 +42,7 @@ require further setup. #} USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% elif build_type == 'explorer-privileged' %} {# This is similar to the 'explorer' build type, but additionally uses the root @@ -51,7 +51,7 @@ thus, install packages, remove packages, or anything else. #} USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% else %} {{ raise("Invalid build type.") }} {% endif %} \ No newline at end of file diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile b/images/airflow/2.10.1/Dockerfiles/Dockerfile index 4aa69fb..8c17f55 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile @@ -8,6 +8,6 @@ FROM amazon-mwaa-docker-images/airflow:2.10.1-base USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile-dev b/images/airflow/2.10.1/Dockerfiles/Dockerfile-dev index 933c915..a6f8462 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile-dev +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile-dev @@ -22,6 +22,6 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer index a0b88bb..34fe1cb 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.10.1-base USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-dev b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-dev index de7eff2..868045a 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-dev +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged index 5eac937..cdad716 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.10.1-base USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged-dev b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged-dev index b7be388..48dc598 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged-dev +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile-explorer-privileged-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.1/Dockerfiles/Dockerfile.base b/images/airflow/2.10.1/Dockerfiles/Dockerfile.base index ffc166c..1cdf53c 100644 --- a/images/airflow/2.10.1/Dockerfiles/Dockerfile.base +++ b/images/airflow/2.10.1/Dockerfiles/Dockerfile.base @@ -37,6 +37,11 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.10.1/bootstrap/01-root-firstpass/001-init.sh b/images/airflow/2.10.1/bootstrap/01-root-firstpass/001-init.sh index d6297ff..23a04ef 100644 --- a/images/airflow/2.10.1/bootstrap/01-root-firstpass/001-init.sh +++ b/images/airflow/2.10.1/bootstrap/01-root-firstpass/001-init.sh @@ -2,3 +2,46 @@ set -e dnf update -y + +# shellcheck source=images/airflow/2.10.3/bootstrap/common.sh +source /bootstrap/common.sh + +verify_env_vars_exist \ + BUILDARCH \ + TINI_DOWNLOAD_BASE_URL \ + TINI_ARM_SUFFIX \ + TINI_X86_SUFFIX \ + TINI_ARM_SHA_CHECKSUM \ + TINI_X86_SHA_CHECKSUM + +dnf install -y wget + +# Create directory for tini +mkdir -p /usr/local/bin + +if [ "${BUILDARCH}" == "amd64" ]; then + TINI_BINARY="${TINI_X86_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_X86_SHA_CHECKSUM}" +elif [ "${BUILDARCH}" == "arm64" ]; then + TINI_BINARY="${TINI_ARM_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_ARM_SHA_CHECKSUM}" +else + echo "Unsupported architecture: ${ARCH}" + exit 1 +fi + +# Download tini binary +mkdir tini_source +wget "${TINI_DOWNLOAD_BASE_URL}${TINI_BINARY}" -P /tini_source + +# Verify checksum +echo "${TINI_SHA_CHECKSUM} /tini_source/${TINI_BINARY}" | sha256sum --check - | grep --basic-regex "^/tini_source/${TINI_BINARY}: OK$" +cp "/tini_source/${TINI_BINARY}" "/usr/local/bin/tini" + +# Make tini executable +chmod +x /usr/local/bin/tini + +# Clean up +rm -rf /tini_source + +dnf remove -y wget \ No newline at end of file diff --git a/images/airflow/2.10.3/Dockerfile.base.j2 b/images/airflow/2.10.3/Dockerfile.base.j2 index e32a094..c04f3da 100644 --- a/images/airflow/2.10.3/Dockerfile.base.j2 +++ b/images/airflow/2.10.3/Dockerfile.base.j2 @@ -31,6 +31,11 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.10.3/Dockerfile.derivatives.j2 b/images/airflow/2.10.3/Dockerfile.derivatives.j2 index 5f7aeee..42031c0 100644 --- a/images/airflow/2.10.3/Dockerfile.derivatives.j2 +++ b/images/airflow/2.10.3/Dockerfile.derivatives.j2 @@ -30,7 +30,7 @@ RUN rm -rf /bootstrap-dev {# This is the standard build type. it is what customer uses.#} USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell {% elif build_type == 'explorer' %} @@ -42,7 +42,7 @@ require further setup. #} USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% elif build_type == 'explorer-privileged' %} {# This is similar to the 'explorer' build type, but additionally uses the root @@ -51,7 +51,7 @@ thus, install packages, remove packages, or anything else. #} USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% else %} {{ raise("Invalid build type.") }} {% endif %} \ No newline at end of file diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile b/images/airflow/2.10.3/Dockerfiles/Dockerfile index 65d84da..dbdcc59 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile @@ -8,6 +8,6 @@ FROM amazon-mwaa-docker-images/airflow:2.10.3-base USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile-dev b/images/airflow/2.10.3/Dockerfiles/Dockerfile-dev index 0635f0f..7365057 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile-dev +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile-dev @@ -22,6 +22,6 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer index a8e0565..2863cf3 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.10.3-base USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-dev b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-dev index d174fb7..b09097b 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-dev +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged index 9c30210..7eb1abb 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.10.3-base USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged-dev b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged-dev index d485d6b..ed3f3d9 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged-dev +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile-explorer-privileged-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.10.3/Dockerfiles/Dockerfile.base b/images/airflow/2.10.3/Dockerfiles/Dockerfile.base index cf944bf..8c53851 100644 --- a/images/airflow/2.10.3/Dockerfiles/Dockerfile.base +++ b/images/airflow/2.10.3/Dockerfiles/Dockerfile.base @@ -37,6 +37,11 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.10.3/bootstrap/01-root-firstpass/001-init.sh b/images/airflow/2.10.3/bootstrap/01-root-firstpass/001-init.sh index d6297ff..6c71bf7 100644 --- a/images/airflow/2.10.3/bootstrap/01-root-firstpass/001-init.sh +++ b/images/airflow/2.10.3/bootstrap/01-root-firstpass/001-init.sh @@ -2,3 +2,46 @@ set -e dnf update -y + +# shellcheck source=images/airflow/2.10.3/bootstrap/common.sh +source /bootstrap/common.sh + +verify_env_vars_exist \ + BUILDARCH \ + TINI_DOWNLOAD_BASE_URL \ + TINI_ARM_SUFFIX \ + TINI_X86_SUFFIX \ + TINI_ARM_SHA_CHECKSUM \ + TINI_X86_SHA_CHECKSUM + +dnf install -y wget + +# Create directory for tini +mkdir -p /usr/local/bin + +if [ "${BUILDARCH}" == "amd64" ]; then + TINI_BINARY="${TINI_X86_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_X86_SHA_CHECKSUM}" +elif [ "${BUILDARCH}" == "arm64" ]; then + TINI_BINARY="${TINI_ARM_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_ARM_SHA_CHECKSUM}" +else + echo "Unsupported architecture: ${ARCH}" + exit 1 +fi + +# Download tini binary +mkdir tini_source +wget "${TINI_DOWNLOAD_BASE_URL}${TINI_BINARY}" -P /tini_source + +# Verify checksum +echo "${TINI_SHA_CHECKSUM} /tini_source/${TINI_BINARY}" | sha256sum --check - | grep --basic-regex "^/tini_source/${TINI_BINARY}: OK$" +cp "/tini_source/${TINI_BINARY}" "/usr/local/bin/tini" + +# Make tini executable +chmod +x /usr/local/bin/tini + +# Clean up +rm -rf /tini_source + +dnf remove -y wget diff --git a/images/airflow/2.9.2/Dockerfile.base.j2 b/images/airflow/2.9.2/Dockerfile.base.j2 index 036f783..b3b1373 100644 --- a/images/airflow/2.9.2/Dockerfile.base.j2 +++ b/images/airflow/2.9.2/Dockerfile.base.j2 @@ -31,6 +31,12 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c + ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.9.2/Dockerfile.derivatives.j2 b/images/airflow/2.9.2/Dockerfile.derivatives.j2 index d7e339c..08cb4de 100644 --- a/images/airflow/2.9.2/Dockerfile.derivatives.j2 +++ b/images/airflow/2.9.2/Dockerfile.derivatives.j2 @@ -30,7 +30,7 @@ RUN rm -rf /bootstrap-dev {# This is the standard build type. it is what customer uses.#} USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell {% elif build_type == 'explorer' %} @@ -42,7 +42,7 @@ require further setup. #} USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% elif build_type == 'explorer-privileged' %} {# This is similar to the 'explorer' build type, but additionally uses the root @@ -51,7 +51,7 @@ thus, install packages, remove packages, or anything else. #} USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] {% else %} {{ raise("Invalid build type.") }} {% endif %} \ No newline at end of file diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile b/images/airflow/2.9.2/Dockerfiles/Dockerfile index 35dea16..61e9699 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile @@ -8,6 +8,6 @@ FROM amazon-mwaa-docker-images/airflow:2.9.2-base USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile-dev b/images/airflow/2.9.2/Dockerfiles/Dockerfile-dev index 28eeef9..bdb7692 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile-dev +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile-dev @@ -22,6 +22,6 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["python3", "-m", "mwaa.entrypoint"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "python3", "-m", "mwaa.entrypoint"] CMD shell diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer index 0a9070b..7f6e4e8 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.9.2-base USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-dev b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-dev index af43bdf..0b2c4c6 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-dev +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER airflow -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged index 9c1af9f..157c941 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged @@ -8,4 +8,4 @@ FROM amazon-mwaa-docker-images/airflow:2.9.2-base USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged-dev b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged-dev index 720a700..10a9646 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged-dev +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile-explorer-privileged-dev @@ -22,4 +22,4 @@ RUN rm -rf /bootstrap-dev USER root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/local/bin/tini", "--", "/bin/bash"] diff --git a/images/airflow/2.9.2/Dockerfiles/Dockerfile.base b/images/airflow/2.9.2/Dockerfiles/Dockerfile.base index 514263b..cc72f73 100644 --- a/images/airflow/2.9.2/Dockerfiles/Dockerfile.base +++ b/images/airflow/2.9.2/Dockerfiles/Dockerfile.base @@ -37,6 +37,11 @@ ARG MARIADB_RPM_DEVEL_ARM_CHECKSUM=a49c1402378581ba2d63d97daa4a4c04 ARG MARIADB_RPM_SHARED_PREFIX=MariaDB-shared-11.4.3-1.fc38 ARG MARIADB_RPM_SHARED_X86_CHECKSUM=26a6c7fb021c09b85c21ec1878c1953f ARG MARIADB_RPM_SHARED_ARM_CHECKSUM=fd2ce395bf7d2cb959495bbd02ffec2e +ARG TINI_DOWNLOAD_BASE_URL=https://github.com/krallin/tini/releases/download/v0.19.0/ +ARG TINI_X86_SUFFIX=tini +ARG TINI_ARM_SUFFIX=tini-arm64 +ARG TINI_ARM_SHA_CHECKSUM=07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 +ARG TINI_X86_SHA_CHECKSUM=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c ENV AIRFLOW_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/airflow_constraints.txt ENV MWAA_ESSENTIAL_CONSTRAINTS_FILE=${AIRFLOW_USER_LOCAL_ETC_PATH}/mwaa_essential_constraints.txt diff --git a/images/airflow/2.9.2/bootstrap/01-root-firstpass/001-init.sh b/images/airflow/2.9.2/bootstrap/01-root-firstpass/001-init.sh index d6297ff..1b9c2b1 100644 --- a/images/airflow/2.9.2/bootstrap/01-root-firstpass/001-init.sh +++ b/images/airflow/2.9.2/bootstrap/01-root-firstpass/001-init.sh @@ -2,3 +2,47 @@ set -e dnf update -y + + +# shellcheck source=images/airflow/2.10.3/bootstrap/common.sh +source /bootstrap/common.sh + +verify_env_vars_exist \ + BUILDARCH \ + TINI_DOWNLOAD_BASE_URL \ + TINI_ARM_SUFFIX \ + TINI_X86_SUFFIX \ + TINI_ARM_SHA_CHECKSUM \ + TINI_X86_SHA_CHECKSUM + +dnf install -y wget + +# Create directory for tini +mkdir -p /usr/local/bin + +if [ "${BUILDARCH}" == "amd64" ]; then + TINI_BINARY="${TINI_X86_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_X86_SHA_CHECKSUM}" +elif [ "${BUILDARCH}" == "arm64" ]; then + TINI_BINARY="${TINI_ARM_SUFFIX}" + TINI_SHA_CHECKSUM="${TINI_ARM_SHA_CHECKSUM}" +else + echo "Unsupported architecture: ${ARCH}" + exit 1 +fi + +# Download tini binary +mkdir tini_source +wget "${TINI_DOWNLOAD_BASE_URL}${TINI_BINARY}" -P /tini_source + +# Verify checksum +echo "${TINI_SHA_CHECKSUM} /tini_source/${TINI_BINARY}" | sha256sum --check - | grep --basic-regex "^/tini_source/${TINI_BINARY}: OK$" +cp "/tini_source/${TINI_BINARY}" "/usr/local/bin/tini" + +# Make tini executable +chmod +x /usr/local/bin/tini + +# Clean up +rm -rf /tini_source + +dnf remove -y wget \ No newline at end of file diff --git a/quality-checks/lint_bash.sh b/quality-checks/lint_bash.sh index 75b0278..180f18c 100755 --- a/quality-checks/lint_bash.sh +++ b/quality-checks/lint_bash.sh @@ -11,7 +11,7 @@ fi # Lint all Bash files echo "Running ShellCheck on Bash scripts..." -if ! find . -type f -name "*.sh" -exec shellcheck {} +; then +if ! find . -type f -name "*.sh" -not -path "./.venv/*" -exec shellcheck {} +; then echo "ShellCheck linting failed." exit 1 else diff --git a/quality-checks/pip_install_check.py b/quality-checks/pip_install_check.py index 34a1eca..27a263a 100755 --- a/quality-checks/pip_install_check.py +++ b/quality-checks/pip_install_check.py @@ -1,4 +1,4 @@ -#!/bin/python3 +#!/usr/bin/env python3 """ This module verifies there are no direct use of "pip install" in the code. diff --git a/quality-checks/run_all.py b/quality-checks/run_all.py index be2f5e6..838d8b3 100755 --- a/quality-checks/run_all.py +++ b/quality-checks/run_all.py @@ -1,4 +1,4 @@ -#!/bin/python3 +#!/usr/bin/env python3 """Run all quality check scripts under the quality-checks/ folder.""" import os