- Building Google Cloud Platform Solutions
- Ted Hunter Steven Porter Legorie Rajan PS
- 215字
- 2021-07-02 12:24:42
Custom runtimes
One of the main benefits of the App Engine flexible environment is the support for custom runtimes. A custom runtime is essentially a non-standard Docker container running on App Engine. Google maintains a collection of Docker images for the various supported language runtimes. These base images are available at https://console.cloud.google.com/gcr/images/google-appengine/GLOBAL. When a non-custom runtime is used, Google will build the Docker image by extending one of these base images, as defined in the runtime property of the app.yaml configuration file.
In some cases, it is useful to either customize one of these runtimes, or use an entirely separate runtime. This allows developers to tweak the runtime to their liking, include system libraries, or deploy applications written in other languages. To use a custom runtime, provide the following fields in the app.yaml configuration file:
runtime: custom
env: flex
When building the container for this service, App Engine will look for a Dockerfile in the same directory as app.yaml. This Dockerfile can extend any base image, including one of the App Engine base images. Generally speaking, it's a good idea to extend one of the Google-provided base images, or a well-known public Docker image when possible.