Inject Executable Script
How to Inject an Executable Script into a Container?
Let's we want to execute a script inside a container. The script is not not a part of the docker image. We have to inject script then execute it.
Solution:
Create a configMap with the script.
Mount the configMap to the container as a volume with
defaultMode: 0744
.Use
command:["/path/to/the/script.sh"]
to run the script.
Last updated