image building documentation: adding new provider example
diff --git a/docs/docker-stack/build.rst b/docs/docker-stack/build.rst
index acd043bdb71f5..2b7d47c9cb0dc 100644
--- a/docs/docker-stack/build.rst
+++ b/docs/docker-stack/build.rst
@@ -274,18 +274,28 @@ You should be aware, about a few things:
 Examples of image extending
 ---------------------------
 
-Example of upgrading Airflow Provider packages
-..............................................
+Example of customizing Airflow Provider packages
+................................................
 
 The :ref:`Airflow Providers <providers:community-maintained-providers>` are released independently of core
 Airflow and sometimes you might want to upgrade specific providers only to fix some problems or
 use features available in that provider version. Here is an example of how you can do it
 
-.. exampleinclude:: docker-examples/extending/add-providers/Dockerfile
+.. exampleinclude:: docker-examples/extending/custom-providers/Dockerfile
     :language: Dockerfile
     :start-after: [START Dockerfile]
     :end-before: [END Dockerfile]
 
+Example of adding Airflow Provider package and ``apt`` package
+..............................................................
+
+The following example adds ``apache-spark`` airflow-providers which requires both ``java`` and
+python package from PyPI.
+
+.. exampleinclude:: docker-examples/extending/add-providers/Dockerfile
+    :language: Dockerfile
+    :start-after: [START Dockerfile]
+    :end-before: [END Dockerfile]
 
 Example of adding ``apt`` package
 .................................
diff --git a/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile b/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
index ffea0b137e258..79a7350fa6e49 100644
--- a/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
+++ b/docs/docker-stack/docker-examples/extending/add-providers/Dockerfile
@@ -16,5 +16,14 @@
 # This is an example Dockerfile. It is not intended for PRODUCTION use
 # [START Dockerfile]
 FROM apache/airflow:2.3.0.dev0
-RUN pip install --no-cache-dir apache-airflow-providers-docker==2.1.0
+USER root
+RUN apt-get update \
+  && apt-get install -y --no-install-recommends \
+         openjdk-11-jre-headless \
+  && apt-get autoremove -yqq --purge \
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+USER airflow
+ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
+RUN pip install --no-cache-dir apache-airflow-providers-apache-spark==2.1.3
 # [END Dockerfile]
diff --git a/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile b/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile
new file mode 100644
index 0000000000000..6e516b6365e62
--- /dev/null
+++ b/docs/docker-stack/docker-examples/extending/custom-providers/Dockerfile
@@ -0,0 +1,20 @@
+# 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.
+
+# This is an example Dockerfile. It is not intended for PRODUCTION use
+# [START Dockerfile]
+FROM apache/airflow:2.3.0.dev0
+RUN pip install --no-cache-dir apache-airflow-providers-docker==2.5.1
+# [END Dockerfile]

* Current "upgrading provider" example is misleading. 
`apache-airflow-providers-docker==2.1.0` is actually a downgrade now days in `apache/airflow:2.2.5` (which shipped with `apache-airflow-providers-docker==2.5.2` ) - so it's more downgrade than upgrade. 
That's why I renamed it to "custom" provider version (as it hard to maintain the version in the example) and I picked a version "in the middle" - 2.5.1
* Following the [last comment](https://stackoverflow.com/a/71142395/1011253) in StackOverflow answer I'm adding a common example of Spark usage which combine both python provider package and `apt` package (+ setting mandatory environment variable `JAVA_HOME`).