Example 20-2. Building the configuration Docker image Example 20-3. Start application container with config container linked Example 20-4. Use different configuration for production environment Solution  |  159 Kubernetes Init Containers docker build -t k8spatterns/config-dev-image:1.0.1 -f Dockerfile-config docker create --name config-dev k8spatterns/config-dev-image:1.0.1 . docker run --volumes-from config-dev k8spatterns/welcome-servlet:1.0 docker build -t k8spatterns/config-prod-image:1.0.1 -f Dockerfile-config docker create --name config-prod k8spatterns/config-prod-image:1.0.1 . docker run --volumes-from config-prod k8spatterns/welcome-servlet:1.0 In the Docker example, we base the configuration Docker image on  scratch , an empty Docker image without any operating system files. We don’t need anything more there because all we want is the configuration data shared via Docker volumes. However, for Kubernetes init containers, we need some help from the base image to copy over the configuration data to a shared Pod volume.  busybox  is a good choice So containers can share (external) volumes, but they cannot yet directly share direc‐ tories located within the containers. In order to use  Immutable Configuration  con‐ tainers in Kubernetes, we can use the  Init Containers  pattern from Chapter 14 that can initialize an empty shared volume during startup. In Kubernetes, volume sharing within a Pod is perfectly suited for this kind of linking of configuration and application containers. However, if we want to transfer this tech‐ nique of Docker volume linking to the Kubernetes world, we will find that there is currently no support for container volumes in Kubernetes. Considering the age of the discussion and the complexity of implementing this feature versus its limited benefits, it’s likely that container volumes will not arrive anytime soon. The application image expects its configuration files within a directory  /config , the volume exposed by the configuration container. When you move this application from the development environment to the production environment, all you have to do is change the startup command. There is no need to alter the application image itself. Instead, you simply volume-link the application container with the production configuration container, as seen in Example 20-4. The final step is to start the application container and connect it to this configuration container (Example 20-3).