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

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


The following commit(s) were added to refs/heads/main by this push:
     new da8004dac8 Explicitly make in-container scripts use Bash (#33548)
da8004dac8 is described below

commit da8004dac8e51a7485637b70a788aad5a0f53c60
Author: Tzu-ping Chung <[email protected]>
AuthorDate: Mon Aug 21 06:12:48 2023 +0800

    Explicitly make in-container scripts use Bash (#33548)
    
    Not every base Python image uses Bash as the default shell, and most
    significantly some use Dash (Debian Almquist shell) instead, which lacks
    some syntax support such as -o pipefail.
    
    While it is possible to rewrite the scripts to be more POSIX compatible,
    I chose to explicitly make everything run in Bash instead since that how
    we set up shellcheck (shell=bash) in the first place.
    
    Thanks to @ttpss930141011 for debugging help.
    
    Co-authored-by: Justin Xiao <[email protected]>
---
 Dockerfile                                                     |  9 +++++++++
 Dockerfile.ci                                                  | 10 ++++++++++
 scripts/docker/common.sh                                       |  1 +
 scripts/docker/install_additional_dependencies.sh              |  1 +
 scripts/docker/install_airflow.sh                              |  1 +
 scripts/docker/install_airflow_dependencies_from_branch_tip.sh |  1 +
 scripts/docker/install_mssql.sh                                |  1 +
 scripts/docker/install_mysql.sh                                |  1 +
 scripts/docker/install_os_dependencies.sh                      |  1 +
 scripts/docker/install_pip_version.sh                          |  1 +
 scripts/docker/install_pipx_tools.sh                           |  1 +
 scripts/docker/install_postgres.sh                             |  1 +
 12 files changed, 29 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index f0dc22ce1c..5023e3ef9a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -73,6 +73,7 @@ FROM scratch as scripts
 
 # The content below is automatically copied from 
scripts/docker/install_os_dependencies.sh
 COPY <<"EOF" /install_os_dependencies.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 DOCKER_CLI_VERSION=20.10.9
@@ -175,6 +176,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_mysql.sh
 COPY <<"EOF" /install_mysql.sh
+#!/usr/bin/env bash
 set -euo pipefail
 declare -a packages
 
@@ -264,6 +266,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_mssql.sh
 COPY <<"EOF" /install_mssql.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
@@ -343,6 +346,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_postgres.sh
 COPY <<"EOF" /install_postgres.sh
+#!/usr/bin/env bash
 set -euo pipefail
 declare -a packages
 
@@ -384,6 +388,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_pip_version.sh
 COPY <<"EOF" /install_pip_version.sh
+#!/usr/bin/env bash
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 : "${AIRFLOW_PIP_VERSION:?Should be set}"
@@ -398,6 +403,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_airflow_dependencies_from_branch_tip.sh
 COPY <<"EOF" /install_airflow_dependencies_from_branch_tip.sh
+#!/usr/bin/env bash
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
@@ -444,6 +450,7 @@ EOF
 
 # The content below is automatically copied from scripts/docker/common.sh
 COPY <<"EOF" /common.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 function common::get_colors() {
@@ -633,6 +640,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_airflow.sh
 COPY <<"EOF" /install_airflow.sh
+#!/usr/bin/env bash
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
@@ -718,6 +726,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_additional_dependencies.sh
 COPY <<"EOF" /install_additional_dependencies.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 : "${UPGRADE_TO_NEWER_DEPENDENCIES:?Should be true or false}"
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 819ee45355..be5b3de193 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -33,6 +33,7 @@ FROM ${PYTHON_BASE_IMAGE} as scripts
 
 # The content below is automatically copied from 
scripts/docker/install_os_dependencies.sh
 COPY <<"EOF" /install_os_dependencies.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 DOCKER_CLI_VERSION=20.10.9
@@ -135,6 +136,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_mysql.sh
 COPY <<"EOF" /install_mysql.sh
+#!/usr/bin/env bash
 set -euo pipefail
 declare -a packages
 
@@ -224,6 +226,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_mssql.sh
 COPY <<"EOF" /install_mssql.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
@@ -303,6 +306,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_postgres.sh
 COPY <<"EOF" /install_postgres.sh
+#!/usr/bin/env bash
 set -euo pipefail
 declare -a packages
 
@@ -344,6 +348,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_pip_version.sh
 COPY <<"EOF" /install_pip_version.sh
+#!/usr/bin/env bash
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 : "${AIRFLOW_PIP_VERSION:?Should be set}"
@@ -358,6 +363,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_airflow_dependencies_from_branch_tip.sh
 COPY <<"EOF" /install_airflow_dependencies_from_branch_tip.sh
+#!/usr/bin/env bash
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
@@ -404,6 +410,7 @@ EOF
 
 # The content below is automatically copied from scripts/docker/common.sh
 COPY <<"EOF" /common.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 function common::get_colors() {
@@ -475,6 +482,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_pipx_tools.sh
 COPY <<"EOF" /install_pipx_tools.sh
+#!/usr/bin/env bash
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 function install_pipx_tools() {
@@ -502,6 +510,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_airflow.sh
 COPY <<"EOF" /install_airflow.sh
+#!/usr/bin/env bash
 
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
@@ -587,6 +596,7 @@ EOF
 
 # The content below is automatically copied from 
scripts/docker/install_additional_dependencies.sh
 COPY <<"EOF" /install_additional_dependencies.sh
+#!/usr/bin/env bash
 set -euo pipefail
 
 : "${UPGRADE_TO_NEWER_DEPENDENCIES:?Should be true or false}"
diff --git a/scripts/docker/common.sh b/scripts/docker/common.sh
index f4fd2e75f7..dfe9b0d8c4 100644
--- a/scripts/docker/common.sh
+++ b/scripts/docker/common.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_additional_dependencies.sh 
b/scripts/docker/install_additional_dependencies.sh
index 488768cf51..742e701f60 100644
--- a/scripts/docker/install_additional_dependencies.sh
+++ b/scripts/docker/install_additional_dependencies.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_airflow.sh 
b/scripts/docker/install_airflow.sh
index f5bbf638c2..56fec40407 100644
--- a/scripts/docker/install_airflow.sh
+++ b/scripts/docker/install_airflow.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_airflow_dependencies_from_branch_tip.sh 
b/scripts/docker/install_airflow_dependencies_from_branch_tip.sh
index 2b58d03950..26279c4bc8 100644
--- a/scripts/docker/install_airflow_dependencies_from_branch_tip.sh
+++ b/scripts/docker/install_airflow_dependencies_from_branch_tip.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_mssql.sh b/scripts/docker/install_mssql.sh
index 883819a225..333c75788b 100644
--- a/scripts/docker/install_mssql.sh
+++ b/scripts/docker/install_mssql.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_mysql.sh b/scripts/docker/install_mysql.sh
index c5d79faddf..89f37c2873 100644
--- a/scripts/docker/install_mysql.sh
+++ b/scripts/docker/install_mysql.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_os_dependencies.sh 
b/scripts/docker/install_os_dependencies.sh
index 6aaa0ba561..2a984fd642 100644
--- a/scripts/docker/install_os_dependencies.sh
+++ b/scripts/docker/install_os_dependencies.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_pip_version.sh 
b/scripts/docker/install_pip_version.sh
index efe4f23c2f..afe46c7c1f 100644
--- a/scripts/docker/install_pip_version.sh
+++ b/scripts/docker/install_pip_version.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_pipx_tools.sh 
b/scripts/docker/install_pipx_tools.sh
index 07fbd92eaf..47f5cd5854 100644
--- a/scripts/docker/install_pipx_tools.sh
+++ b/scripts/docker/install_pipx_tools.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
diff --git a/scripts/docker/install_postgres.sh 
b/scripts/docker/install_postgres.sh
index 57f4ec9722..252826f77c 100644
--- a/scripts/docker/install_postgres.sh
+++ b/scripts/docker/install_postgres.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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

Reply via email to