tvalentyn commented on a change in pull request #16938:
URL: https://github.com/apache/beam/pull/16938#discussion_r828534832
##########
File path: website/www/site/content/en/documentation/runtime/environments.md
##########
@@ -171,6 +171,48 @@ creates a Java 8 SDK image with appropriate licenses in
`/opt/apache/beam/third_
By default, no licenses/notices are added to the docker images.
+#### Modifying an existing container image to make it compatible with Apache
Beam Runners {#modify-existing-base-image}
+Beam offers a way to provide your own custom container image. The easiest way
to build a new custom image that is compatible with Apache Beam Runners is to
use a [multi-stage
build](https://docs.docker.com/develop/develop-images/multistage-build/)
process. This copies over the necessary artifacts from a default Apache Beam
base image to build your custom container image.
+
+1. Copy necessary artifacts from Apache Beam base image to your image.
+ ```
+ # This can be any container image,
+ FROM python:3.7-bullseye
+
+ # Install SDK. (needed for Python SDK)
+ RUN pip install --no-cache-dir apache-beam[gcp]==2.35.0
+
+ # Copy files from official SDK image, including script/dependencies.
+ COPY --from=apache/beam_python3.7_sdk:2.35.0 /opt/apache/beam /opt/apache/beam
+
+ # Perform any additional customizations if desired
+
+ # Set the entrypoint to Apache Beam SDK launcher.
+ ENTRYPOINT ["/opt/apache/beam/boot"]
+
+ ```
+>**NOTE**: This example assumes necessary dependencies (in this case, Python
3.7 and pip) have been installed on the existing base image. Installing the
Apache Beam SDK into the image will ensure that the image has the necessary SDK
dependencies and reduce the worker startup time.
+>The version specified in the `RUN` instruction must match the version used to
launch the pipeline.<br>
Review comment:
I'd expand this to smth like:
The Apache Beam version and the Python version specified in the custom
Dockerfile must match the versions used to launch the pipeline.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]