You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/03/01 12:52:13 UTC

[airflow] branch main updated: Switch to Debian 11 (bullseye) as base for our dockerfiles (#21378) (#21875)

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 3035d3a  Switch to Debian 11 (bullseye) as base for our dockerfiles (#21378) (#21875)
3035d3a is described below

commit 3035d3ab1629d56f3c1084283bed5a9c43258e90
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Mar 1 13:50:49 2022 +0100

    Switch to Debian 11 (bullseye) as base for our dockerfiles (#21378) (#21875)
    
    Debian 11 Bullseye have been released some time ago as the new
    LTS Debian release and already all our dependencies (including
    MySQL and MSSQL ODBC drivers) caught up with it so we can finally
    migrate to it.
    
    This change switches base images to bullsey for our Dockerfiles
    as well as for Redis image we are using in CI.
    
    The relevant packages have been updated to include that
    and documentation have been updated.
    
    Examples of ours also are updated to use "bullseye" rather than
    buster.
    
    Closes: #18190
    Closes: #18279
---
 .github/workflows/build-images.yml                     |  1 +
 .github/workflows/ci.yml                               |  1 +
 BREEZE.rst                                             | 16 ++++++++--------
 CI.rst                                                 |  4 ++--
 Dockerfile                                             |  2 +-
 Dockerfile.ci                                          |  2 +-
 IMAGES.rst                                             | 18 +++++++++---------
 README.md                                              |  2 +-
 TESTING.rst                                            |  2 +-
 .../tutorial_taskflow_api_etl_docker_virtualenv.py     |  2 +-
 breeze-complete                                        |  2 +-
 chart/values.schema.json                               |  2 +-
 chart/values.yaml                                      |  2 +-
 .../0004-using-docker-images-as-test-environment.md    |  2 +-
 dev/breeze/src/airflow_breeze/ci/build_params.py       |  4 ++--
 .../apache-airflow-providers-odbc/connections/odbc.rst |  6 +++---
 docs/apache-airflow/howto/set-up-database.rst          |  2 +-
 docs/apache-airflow/installation/dependencies.rst      |  2 +-
 docs/apache-airflow/installation/prerequisites.rst     |  2 +-
 docs/apache-airflow/start/docker.rst                   |  2 +-
 docs/docker-stack/build-arg-ref.rst                    |  2 +-
 docs/docker-stack/build.rst                            |  4 ++--
 .../customizing/add-build-essential-custom.sh          |  2 +-
 .../docker-examples/customizing/custom-sources.sh      |  2 +-
 .../customizing/github-different-repository.sh         |  2 +-
 .../docker-examples/customizing/github-main.sh         |  2 +-
 .../docker-examples/customizing/github-v2-2-test.sh    |  2 +-
 .../customizing/pypi-dev-runtime-deps.sh               |  2 +-
 .../customizing/pypi-extras-and-deps.sh                |  2 +-
 .../customizing/pypi-selected-version.sh               |  2 +-
 .../restricted/restricted_environments.sh              |  2 +-
 scripts/ci/libraries/_initialization.sh                |  2 +-
 32 files changed, 52 insertions(+), 50 deletions(-)

diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml
index 3d77b51..636b921 100644
--- a/.github/workflows/build-images.yml
+++ b/.github/workflows/build-images.yml
@@ -31,6 +31,7 @@ env:
   FORCE_ANSWER_TO_QUESTIONS: "yes"
   CHECK_IMAGE_FOR_REBUILD: "true"
   SKIP_CHECK_REMOTE_IMAGE: "true"
+  DEBIAN_VERSION: "bullseye"
   DB_RESET: "true"
   VERBOSE: "true"
   GITHUB_REPOSITORY: ${{ github.repository }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ccf11a2..e951a89 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -32,6 +32,7 @@ env:
   FORCE_ANSWER_TO_QUESTIONS: "yes"
   CHECK_IMAGE_FOR_REBUILD: "true"
   SKIP_CHECK_REMOTE_IMAGE: "true"
+  DEBIAN_VERSION: "bullseye"
   DB_RESET: "true"
   VERBOSE: "true"
   DOCKER_CACHE: "pulled"
diff --git a/BREEZE.rst b/BREEZE.rst
index b267666..574b5fe 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -1285,7 +1285,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -a, --install-airflow-version INSTALL_AIRFLOW_VERSION
           Uses different version of Airflow when building PROD image.
@@ -1500,7 +1500,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -a, --install-airflow-version INSTALL_AIRFLOW_VERSION
           Uses different version of Airflow when building PROD image.
@@ -1575,7 +1575,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -I, --production-image
           Use production image for entering the environment and builds (not for tests).
@@ -1657,7 +1657,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -v, --verbose
           Show verbose information about executed docker, kind, kubectl, helm commands. Useful for
@@ -1708,7 +1708,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
 
   ####################################################################################################
@@ -1918,7 +1918,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -b, --backend BACKEND
           Backend to use for tests - it determines which database is used.
@@ -2002,7 +2002,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   -F, --force-build-images
           Forces building of the local docker images. The images are rebuilt
@@ -2417,7 +2417,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 buster bullseye
+                 bullseye buster
 
   ****************************************************************************************************
    Choose backend to run for Airflow
diff --git a/CI.rst b/CI.rst
index 6a9a409..5c32174 100644
--- a/CI.rst
+++ b/CI.rst
@@ -607,11 +607,11 @@ have to be percent-encoded when you access them via UI (/ = %2F)
 +--------------+----------------------------------------------------------+----------------------------------------------------------+
 | Image        | Name:tag (both cases latest version and per-build)       | Description                                              |
 +==============+==========================================================+==========================================================+
-| Python image | python:<X.Y>-slim-buster                                 | Base Python image used by both production and CI image.  |
+| Python image | python:<X.Y>-slim-bullseye                               | Base Python image used by both production and CI image.  |
 | (DockerHub)  |                                                          | Python maintainer release new versions of those image    |
 |              |                                                          | with security fixes every few weeks in DockerHub.        |
 +--------------+----------------------------------------------------------+----------------------------------------------------------+
-| Airflow      | airflow/<BRANCH>/python:<X.Y>-slim-buster                | Version of python base image used in Airflow Builds      |
+| Airflow      | airflow/<BRANCH>/python:<X.Y>-slim-bullseye              | Version of python base image used in Airflow Builds      |
 | python base  |                                                          | We keep the "latest" version only to mark last "good"    |
 | image        |                                                          | python base that went through testing and was pushed.    |
 +--------------+----------------------------------------------------------+----------------------------------------------------------+
diff --git a/Dockerfile b/Dockerfile
index f353abd..56b1b8f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -46,7 +46,7 @@ ARG AIRFLOW_USER_HOME_DIR=/home/airflow
 # latest released version here
 ARG AIRFLOW_VERSION="2.2.4"
 
-ARG PYTHON_BASE_IMAGE="python:3.7-slim-buster"
+ARG PYTHON_BASE_IMAGE="python:3.7-slim-bullseye"
 
 ARG AIRFLOW_PIP_VERSION=22.0.3
 ARG AIRFLOW_IMAGE_REPOSITORY="https://github.com/apache/airflow"
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 005ee8c..49d5f85 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -15,7 +15,7 @@
 #
 # WARNING: THIS DOCKERFILE IS NOT INTENDED FOR PRODUCTION USE OR DEPLOYMENT.
 #
-ARG PYTHON_BASE_IMAGE="python:3.7-slim-buster"
+ARG PYTHON_BASE_IMAGE="python:3.7-slim-bullseye"
 FROM ${PYTHON_BASE_IMAGE} as main
 
 # Nolog bash flag is currently ignored - but you can replace it with other flags (for example
diff --git a/IMAGES.rst b/IMAGES.rst
index 23de4b8..e1dec6c 100644
--- a/IMAGES.rst
+++ b/IMAGES.rst
@@ -318,7 +318,7 @@ It is recommended to build images with ``DOCKER_BUILDKIT=1`` variable
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg ADDITIONAL_AIRFLOW_EXTRAS="jdbc"
     --build-arg ADDITIONAL_PYTHON_DEPS="pandas"
     --build-arg ADDITIONAL_DEV_APT_DEPS="gcc g++"
@@ -344,7 +344,7 @@ based on example in `this comment <https://github.com/apache/airflow/issues/8605
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg AIRFLOW_INSTALLATION_METHOD="apache-airflow" \
     --build-arg ADDITIONAL_AIRFLOW_EXTRAS="slack" \
     --build-arg ADDITIONAL_PYTHON_DEPS="apache-airflow-providers-odbc \
@@ -372,7 +372,7 @@ The following build arguments (``--build-arg`` in docker build command) can be u
 +------------------------------------------+------------------------------------------+------------------------------------------+
 | Build argument                           | Default value                            | Description                              |
 +==========================================+==========================================+==========================================+
-| ``PYTHON_BASE_IMAGE``                    | ``python:3.7-slim-buster``               | Base Python image                        |
+| ``PYTHON_BASE_IMAGE``                    | ``python:3.7-slim-bullseye``             | Base Python image                        |
 +------------------------------------------+------------------------------------------+------------------------------------------+
 | ``PYTHON_MAJOR_MINOR_VERSION``           | ``3.6``                                  | major/minor version of Python (should    |
 |                                          |                                          | match base image)                        |
@@ -489,7 +489,7 @@ This builds the CI image in version 3.7 with default extras ("all").
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
      --pull \
-     --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" --tag my-image:0.0.1
+     --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" --tag my-image:0.0.1
 
 
 This builds the CI image in version 3.6 with "gcp" extra only.
@@ -498,7 +498,7 @@ This builds the CI image in version 3.6 with "gcp" extra only.
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg AIRFLOW_EXTRAS=gcp --tag my-image:0.0.1
 
 
@@ -508,7 +508,7 @@ This builds the CI image in version 3.6 with "apache-beam" extra added.
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg ADDITIONAL_AIRFLOW_EXTRAS="apache-beam" --tag my-image:0.0.1
 
 This builds the CI image in version 3.6 with "mssql" additional package added.
@@ -517,7 +517,7 @@ This builds the CI image in version 3.6 with "mssql" additional package added.
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg ADDITIONAL_PYTHON_DEPS="mssql" --tag my-image:0.0.1
 
 This builds the CI image in version 3.6 with "gcc" and "g++" additional apt dev dependencies added.
@@ -526,7 +526,7 @@ This builds the CI image in version 3.6 with "gcc" and "g++" additional apt dev
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg ADDITIONAL_DEV_APT_DEPS="gcc g++" --tag my-image:0.0.1
 
 This builds the CI image in version 3.6 with "jdbc" extra and "default-jre-headless" additional apt runtime dependencies added.
@@ -535,7 +535,7 @@ This builds the CI image in version 3.6 with "jdbc" extra and "default-jre-headl
 
   DOCKER_BUILDKIT=1 docker build . -f Dockerfile.ci \
     --pull \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg AIRFLOW_EXTRAS=jdbc --build-arg ADDITIONAL_RUNTIME_DEPS="default-jre-headless" \
     --tag my-image:0.0.1
 
diff --git a/README.md b/README.md
index a710dc1..e27c4f3 100644
--- a/README.md
+++ b/README.md
@@ -109,7 +109,7 @@ The work to add Windows support is tracked via [#10388](https://github.com/apach
 it is not a high priority. You should only use Linux-based distros as "Production" execution environment
 as this is the only environment that is supported. The only distro that is used in our CI tests and that
 is used in the [Community managed DockerHub image](https://hub.docker.com/p/apache/airflow) is
-`Debian Buster`.
+`Debian Bullseye`.
 
 ## Getting started
 
diff --git a/TESTING.rst b/TESTING.rst
index 737c760..24cb63d 100644
--- a/TESTING.rst
+++ b/TESTING.rst
@@ -1248,7 +1248,7 @@ Below are the steps you need to take to set up your virtual machine in the Googl
         --zone="${GCP_ZONE}" \
         --machine-type=f1-micro \
         --subnet="${GCP_NETWORK_NAME}" \
-        --image=debian-10-buster-v20200210 \
+        --image=debian-11-bullseye-v20220120 \
         --image-project=debian-cloud \
         --preemptible
 
diff --git a/airflow/providers/docker/example_dags/tutorial_taskflow_api_etl_docker_virtualenv.py b/airflow/providers/docker/example_dags/tutorial_taskflow_api_etl_docker_virtualenv.py
index 1961c30..c16588c 100644
--- a/airflow/providers/docker/example_dags/tutorial_taskflow_api_etl_docker_virtualenv.py
+++ b/airflow/providers/docker/example_dags/tutorial_taskflow_api_etl_docker_virtualenv.py
@@ -62,7 +62,7 @@ def tutorial_taskflow_api_etl_docker_virtualenv():
     # [END extract_virtualenv]
 
     # [START transform_docker]
-    @task.docker(image='python:3.9-slim-buster', multiple_outputs=True)
+    @task.docker(image='python:3.9-slim-bullseye', multiple_outputs=True)
     def transform(order_data_dict: dict):
         """
         #### Transform task
diff --git a/breeze-complete b/breeze-complete
index 85dbc57..ea0cc95 100644
--- a/breeze-complete
+++ b/breeze-complete
@@ -23,7 +23,7 @@
 # Those cannot be made read-only as the breeze-complete must be re-sourceable
 
 _breeze_allowed_python_major_minor_versions="3.7 3.8 3.9"
-_breeze_allowed_debian_versions="buster bullseye"
+_breeze_allowed_debian_versions="bullseye buster"
 _breeze_allowed_backends="sqlite mysql postgres mssql"
 _breeze_allowed_integrations="cassandra kerberos mongo openldap pinot rabbitmq redis statsd trino all"
 _breeze_allowed_generate_constraints_modes="source-providers pypi-providers no-providers"
diff --git a/chart/values.schema.json b/chart/values.schema.json
index 1cd46b8..8deca82 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -568,7 +568,7 @@
                         "tag": {
                             "description": "The redis image tag.",
                             "type": "string",
-                            "default": "6-buster"
+                            "default": "6-bullseye"
                         },
                         "pullPolicy": {
                             "description": "The redis image pull policy.",
diff --git a/chart/values.yaml b/chart/values.yaml
index 2fc50fa..4c43a2a 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -78,7 +78,7 @@ images:
     pullPolicy: IfNotPresent
   redis:
     repository: redis
-    tag: 6-buster
+    tag: 6-bullseye
     pullPolicy: IfNotPresent
   pgbouncer:
     repository: apache/airflow
diff --git a/dev/breeze/doc/adr/0004-using-docker-images-as-test-environment.md b/dev/breeze/doc/adr/0004-using-docker-images-as-test-environment.md
index 1ce4c05..4acb1c3 100644
--- a/dev/breeze/doc/adr/0004-using-docker-images-as-test-environment.md
+++ b/dev/breeze/doc/adr/0004-using-docker-images-as-test-environment.md
@@ -120,7 +120,7 @@ suited for the job:
 * management and automated synchronisation of the environment can be easily done using simple, external
   scripts that will check the "freshness" of the images and propose corrective actions (pulling or
   rebuilding the image) for the user whenever they are needed (all that in cross-platform way)
-* we can use specific base image (Debian Buster with Long Term Support) and rely on security fixes provided
+* we can use specific base image (Debian Bullseye with Long Term Support) and rely on security fixes provided
   by Debian for system dependencies.
 
 The only alternative considered is a plain virtualenv managed individually by each user. The problem with
diff --git a/dev/breeze/src/airflow_breeze/ci/build_params.py b/dev/breeze/src/airflow_breeze/ci/build_params.py
index 82a5951..0e19632 100644
--- a/dev/breeze/src/airflow_breeze/ci/build_params.py
+++ b/dev/breeze/src/airflow_breeze/ci/build_params.py
@@ -77,8 +77,8 @@ class BuildParams:
     @property
     def python_base_image(self):
         """Construct Python Base Image"""
-        #  ghcr.io/apache/airflow/main/python:3.8-slim-buster
-        return f'{self.airflow_image_name}/{self.airflow_branch}/python:{self.python_version}-slim-buster'
+        #  ghcr.io/apache/airflow/main/python:3.8-slim-bullseye
+        return f'{self.airflow_image_name}/{self.airflow_branch}/python:{self.python_version}-slim-bullseye'
 
     @property
     def airflow_ci_local_manifest_image(self):
diff --git a/docs/apache-airflow-providers-odbc/connections/odbc.rst b/docs/apache-airflow-providers-odbc/connections/odbc.rst
index e4bd83c..5d71559 100644
--- a/docs/apache-airflow-providers-odbc/connections/odbc.rst
+++ b/docs/apache-airflow-providers-odbc/connections/odbc.rst
@@ -78,7 +78,7 @@ Extra (optional)
     .. code-block:: json
 
         {
-          "Driver": "ODBC Driver 17 for SQL Server",
+          "Driver": "ODBC Driver 18 for SQL Server",
           "ApplicationIntent": "ReadOnly",
           "TrustedConnection": "Yes"
         }
@@ -96,7 +96,7 @@ Extra (optional)
 
     .. code-block:: bash
 
-        export AIRFLOW_CONN_MSSQL_DEFAULT='mssql-odbc://my_user:XXXXXXXXXXXX@1.1.1.1:1433/my_database?Driver=ODBC+Driver+17+for+SQL+Server&ApplicationIntent=ReadOnly&TrustedConnection=Yes'
+        export AIRFLOW_CONN_MSSQL_DEFAULT='mssql-odbc://my_user:XXXXXXXXXXXX@1.1.1.1:1433/my_database?Driver=ODBC+Driver+18+for+SQL+Server&ApplicationIntent=ReadOnly&TrustedConnection=Yes'
 
     If you want to pass keyword arguments to ``pyodbc.connect``, you may supply a dictionary
     under ``connect_kwargs``.
@@ -107,7 +107,7 @@ Extra (optional)
     .. code-block:: json
 
         {
-          "Driver": "ODBC Driver 17 for SQL Server",
+          "Driver": "ODBC Driver 18 for SQL Server",
           "ApplicationIntent": "ReadOnly",
           "TrustedConnection": "Yes",
           "connect_kwargs": {
diff --git a/docs/apache-airflow/howto/set-up-database.rst b/docs/apache-airflow/howto/set-up-database.rst
index c1e6ccb..2ca8cb9 100644
--- a/docs/apache-airflow/howto/set-up-database.rst
+++ b/docs/apache-airflow/howto/set-up-database.rst
@@ -324,7 +324,7 @@ Official Docker image we have ODBC driver installed, so you need to specify the
 
 .. code-block:: text
 
-    mssql+pyodbc://<user>:<password>@<host>[:port]/<db>[?driver=ODBC+Driver+17+for+SQL+Server]
+    mssql+pyodbc://<user>:<password>@<host>[:port]/<db>[?driver=ODBC+Driver+18+for+SQL+Server]
 
 
 Other configuration options
diff --git a/docs/apache-airflow/installation/dependencies.rst b/docs/apache-airflow/installation/dependencies.rst
index a5bd2e7..912cb4e 100644
--- a/docs/apache-airflow/installation/dependencies.rst
+++ b/docs/apache-airflow/installation/dependencies.rst
@@ -71,7 +71,7 @@ System dependencies
 '''''''''''''''''''
 
 You need certain system level requirements in order to install Airflow. Those are requirements that are known
-to be needed for Linux system (Tested on Ubuntu Buster LTS) :
+to be needed for Linux system (Tested on Ubuntu Bullseye LTS) :
 
 .. code-block:: bash
 
diff --git a/docs/apache-airflow/installation/prerequisites.rst b/docs/apache-airflow/installation/prerequisites.rst
index 5b878ec..2bb76af 100644
--- a/docs/apache-airflow/installation/prerequisites.rst
+++ b/docs/apache-airflow/installation/prerequisites.rst
@@ -51,4 +51,4 @@ The work to add Windows support is tracked via `#10388 <https://github.com/apach
 it is not a high priority. You should only use Linux-based distros as "Production" execution environment
 as this is the only environment that is supported. The only distro that is used in our CI tests and that
 is used in the `Community managed DockerHub image <https://hub.docker.com/p/apache/airflow>`__ is
-``Debian Buster``.
+``Debian Bullseye``.
diff --git a/docs/apache-airflow/start/docker.rst b/docs/apache-airflow/start/docker.rst
index 377ef99..fbab8ff 100644
--- a/docs/apache-airflow/start/docker.rst
+++ b/docs/apache-airflow/start/docker.rst
@@ -57,7 +57,7 @@ Older versions of ``docker-compose`` do not support all the features required by
 
     .. code-block:: bash
 
-        docker run --rm "debian:buster-slim" bash -c 'numfmt --to iec $(echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))))'
+        docker run --rm "debian:bullseye-slim" bash -c 'numfmt --to iec $(echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))))'
 
 
 ``docker-compose.yaml``
diff --git a/docs/docker-stack/build-arg-ref.rst b/docs/docker-stack/build-arg-ref.rst
index aa40154..23f2b3b 100644
--- a/docs/docker-stack/build-arg-ref.rst
+++ b/docs/docker-stack/build-arg-ref.rst
@@ -30,7 +30,7 @@ Those are the most common arguments that you use when you want to build a custom
 +------------------------------------------+------------------------------------------+---------------------------------------------+
 | Build argument                           | Default value                            | Description                                 |
 +==========================================+==========================================+=============================================+
-| ``PYTHON_BASE_IMAGE``                    | ``python:3.7-slim-buster``               | Base python image.                          |
+| ``PYTHON_BASE_IMAGE``                    | ``python:3.7-slim-bullseye``             | Base python image.                          |
 +------------------------------------------+------------------------------------------+---------------------------------------------+
 | ``AIRFLOW_VERSION``                      | :subst-code:`|airflow-version|`          | version of Airflow.                         |
 +------------------------------------------+------------------------------------------+---------------------------------------------+
diff --git a/docs/docker-stack/build.rst b/docs/docker-stack/build.rst
index 131ccaf..9abbdce 100644
--- a/docs/docker-stack/build.rst
+++ b/docs/docker-stack/build.rst
@@ -416,8 +416,8 @@ to make sure to update those requirements and rebuild the images to account for
 Choosing Debian version when customizing the image
 --------------------------------------------------
 
-The reference Airflow image currently uses ``buster`` version of Debian (also known as Debian 10) as base
-image, however when you want to build a custom image, you can also use ``bullseye`` version of base images.
+The reference Airflow image currently uses ``bullseye`` version of Debian (also known as Debian 10) as base
+image, however when you want to build a custom image, you can also use ``buster`` version of base images.
 Airflow supports both versions of Debian. You choose which version of Debian to use by choosing the
 right version of python base image:
 
diff --git a/docs/docker-stack/docker-examples/customizing/add-build-essential-custom.sh b/docs/docker-stack/docker-examples/customizing/add-build-essential-custom.sh
index 743a068..34ff61d 100755
--- a/docs/docker-stack/docker-examples/customizing/add-build-essential-custom.sh
+++ b/docs/docker-stack/docker-examples/customizing/add-build-essential-custom.sh
@@ -23,7 +23,7 @@ cd "${AIRFLOW_SOURCES}"
 
 # [START build]
 export AIRFLOW_VERSION=2.2.2
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/custom-sources.sh b/docs/docker-stack/docker-examples/customizing/custom-sources.sh
index 829545f..47842bb 100755
--- a/docs/docker-stack/docker-examples/customizing/custom-sources.sh
+++ b/docs/docker-stack/docker-examples/customizing/custom-sources.sh
@@ -23,7 +23,7 @@ cd "${AIRFLOW_SOURCES}"
 
 # [START build]
 export AIRFLOW_VERSION=2.2.2
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . -f Dockerfile \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/github-different-repository.sh b/docs/docker-stack/docker-examples/customizing/github-different-repository.sh
index 93c590c..4c251eb 100755
--- a/docs/docker-stack/docker-examples/customizing/github-different-repository.sh
+++ b/docs/docker-stack/docker-examples/customizing/github-different-repository.sh
@@ -21,7 +21,7 @@ set -euo pipefail
 AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
 cd "${AIRFLOW_SOURCES}"
 # [START build]
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/github-main.sh b/docs/docker-stack/docker-examples/customizing/github-main.sh
index 1bdf32a..afd6740 100755
--- a/docs/docker-stack/docker-examples/customizing/github-main.sh
+++ b/docs/docker-stack/docker-examples/customizing/github-main.sh
@@ -22,7 +22,7 @@ AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
 cd "${AIRFLOW_SOURCES}"
 
 # [START build]
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/github-v2-2-test.sh b/docs/docker-stack/docker-examples/customizing/github-v2-2-test.sh
index 1051450..6c70edd 100755
--- a/docs/docker-stack/docker-examples/customizing/github-v2-2-test.sh
+++ b/docs/docker-stack/docker-examples/customizing/github-v2-2-test.sh
@@ -22,7 +22,7 @@ AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
 cd "${AIRFLOW_SOURCES}"
 
 # [START build]
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 docker build . \
     --pull \
     --build-arg PYTHON_BASE_IMAGE="python:3.8-slim-${DEBIAN_VERSION}" \
diff --git a/docs/docker-stack/docker-examples/customizing/pypi-dev-runtime-deps.sh b/docs/docker-stack/docker-examples/customizing/pypi-dev-runtime-deps.sh
index 06ac690..d6d06b6 100755
--- a/docs/docker-stack/docker-examples/customizing/pypi-dev-runtime-deps.sh
+++ b/docs/docker-stack/docker-examples/customizing/pypi-dev-runtime-deps.sh
@@ -23,7 +23,7 @@ cd "${AIRFLOW_SOURCES}"
 
 # [START build]
 export AIRFLOW_VERSION=2.2.2
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/pypi-extras-and-deps.sh b/docs/docker-stack/docker-examples/customizing/pypi-extras-and-deps.sh
index 3e9a1a1..d0fe2fe 100755
--- a/docs/docker-stack/docker-examples/customizing/pypi-extras-and-deps.sh
+++ b/docs/docker-stack/docker-examples/customizing/pypi-extras-and-deps.sh
@@ -23,7 +23,7 @@ cd "${AIRFLOW_SOURCES}"
 
 # [START build]
 export AIRFLOW_VERSION=2.2.2
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/docs/docker-stack/docker-examples/customizing/pypi-selected-version.sh b/docs/docker-stack/docker-examples/customizing/pypi-selected-version.sh
index aa4ddf1..21abbb4 100755
--- a/docs/docker-stack/docker-examples/customizing/pypi-selected-version.sh
+++ b/docs/docker-stack/docker-examples/customizing/pypi-selected-version.sh
@@ -26,7 +26,7 @@ export AIRFLOW_VERSION=2.2.2
 
 docker build . \
     --build \
-    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster" \
+    --build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
     --build-arg AIRFLOW_VERSION="${AIRFLOW_VERSION}" \
     --tag "my-pypi-selected-version:0.0.1"
 # [END build]
diff --git a/docs/docker-stack/docker-examples/restricted/restricted_environments.sh b/docs/docker-stack/docker-examples/restricted/restricted_environments.sh
index bceef32..31576dd 100755
--- a/docs/docker-stack/docker-examples/restricted/restricted_environments.sh
+++ b/docs/docker-stack/docker-examples/restricted/restricted_environments.sh
@@ -34,7 +34,7 @@ pip download --dest docker-context-files \
 # [END download]
 
 # [START build]
-export DEBIAN_VERSION="buster"
+export DEBIAN_VERSION="bullseye"
 
 docker build . \
     --pull \
diff --git a/scripts/ci/libraries/_initialization.sh b/scripts/ci/libraries/_initialization.sh
index 7a2f25e..a59641d 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -353,7 +353,7 @@ function initialization::initialize_image_build_variables() {
     # Default build id
     export CI_BUILD_ID="${CI_BUILD_ID:="0"}"
 
-    export DEBIAN_VERSION=${DEBIAN_VERSION:="buster"}
+    export DEBIAN_VERSION=${DEBIAN_VERSION:="bullseye"}
 
     # Default extras used for building Production image. The canonical source of this information is in the Dockerfile
     DEFAULT_PROD_EXTRAS=$(grep "ARG AIRFLOW_EXTRAS=" "${AIRFLOW_SOURCES}/Dockerfile" |