Home / Companies / Octopus Deploy / Blog / Post Details
Content Deep Dive

Modifying Docker images during Kubernetes deployments

Blog post from Octopus Deploy

Post Details
Company
Date Published
Author
Matthew Casperson
Word Count
1,501
Language
English
Hacker News Points
-
Summary

The process of deploying applications with Octopus involves using variable substitution in files to customize generic application packages for different environments, which is straightforward with standard archives like ZIPs or NUPKGs but more complex with Docker images due to the way layers are built and the expectation of Kubernetes to pull images directly from a repository. To address this, open-source tools like skopeo and umoci can be utilized to download and unpack Docker images, allowing individual files to be mounted into Kubernetes Pods, achieving a similar result to deploying a modified package. By using a combination of a bash script, these tools, and Kubernetes ConfigMaps, the contents of a template file can be processed to include environment-specific information, which is then mounted into a Kubernetes Pod, effectively replacing the original file with a customized version, thus enabling the deployment of generic packages across different environments without the need for environment-specific Docker images.