Getting options for your executable code

Aside from the ENTRYPOINT and CMD defined when you create your container, a container image can also define environment variables, usually via the ENV command when creating the container image. The ENTRYPOINT, CMD, and the environment variables can be overwritten or updated at execution time or when defining a deployment. Environment variables therefore become one of the most common ways of passing in configuration to your container.

Writing your software to utilize these environment variables will be important. As you create your software, make sure that you can take advantage of environment variables as well as command-line arguments in your code. Most languages have a library that will support options ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.