AnandInguva commented on a change in pull request #16938:
URL: https://github.com/apache/beam/pull/16938#discussion_r821074354



##########
File path: website/www/site/content/en/documentation/runtime/environments.md
##########
@@ -171,6 +171,49 @@ 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.
 
+#### Build an existing container image to make it compatible with Apache Beam 
Runners {#modify-existing-base-image}
+Beam offers a way to take a Beam container image and customize it. But if you 
have an existing base image to be compatible with Apache Beam Runners, use a 
[multi-stage 
build](https://docs.docker.com/develop/develop-images/multistage-build/) 
process to copy over the necessary artifacts from a default Apache Beam base 
image and provide 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.8-slim
+
+ # Install SDK. (needed for Python SDK)
+ RUN pip install --no-cache-dir apache-beam[gcp]==2.25.0

Review comment:
       Okay. If I use ARG and in the docker container, I tried 'import 
apache_beam'. I got this error.
   
   ```
   >>> import apache_beam
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/local/lib/python3.6/dist-packages/apache_beam/__init__.py", 
line 93, in <module>
       from apache_beam import io
     File "/usr/local/lib/python3.6/dist-packages/apache_beam/io/__init__.py", 
line 21, in <module>
       from apache_beam.io.avroio import *
     File "/usr/local/lib/python3.6/dist-packages/apache_beam/io/avroio.py", 
line 53, in <module>
       from apache_beam.io import filebasedsink
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/io/filebasedsink.py", line 
29, in <module>
       from apache_beam.io import iobase
     File "/usr/local/lib/python3.6/dist-packages/apache_beam/io/iobase.py", 
line 54, in <module>
       from apache_beam.transforms import Impulse
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/transforms/__init__.py", 
line 24, in <module>
       from apache_beam.transforms.external import *
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/transforms/external.py", 
line 44, in <module>
       from apache_beam.runners import pipeline_context
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/runners/__init__.py", line 
29, in <module>
       from apache_beam.runners.dataflow.dataflow_runner import DataflowRunner
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/runners/dataflow/__init__.py",
 line 24, in <module>
       from apache_beam.runners.dataflow.dataflow_runner import DataflowRunner
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/runners/dataflow/dataflow_runner.py",
 line 43, in <module>
       from apache_beam.internal.gcp import json_value
     File 
"/usr/local/lib/python3.6/dist-packages/apache_beam/internal/gcp/json_value.py",
 line 27, in <module>
       from apitools.base.py import extra_types
     File 
"/usr/local/lib/python3.6/dist-packages/apitools/base/py/__init__.py", line 21, 
in <module>
       from apitools.base.py.base_api import *
     File 
"/usr/local/lib/python3.6/dist-packages/apitools/base/py/base_api.py", line 35, 
in <module>
       from apitools.base.py import http_wrapper
     File 
"/usr/local/lib/python3.6/dist-packages/apitools/base/py/http_wrapper.py", line 
29, in <module>
       import httplib2
     File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 
52, in <module>
       from . import auth
     File "/usr/local/lib/python3.6/dist-packages/httplib2/auth.py", line 20, 
in <module>
       auth_param_name = 
token.copy().setName("auth-param-name").addParseAction(pp.downcaseTokens)
   AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'
   ```




-- 
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]


Reply via email to