Skip to content

witcom-gmbh/docker-env2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

env2json

Docker image that creates json-file from ENV-variables with certain prefixes. Use-case - dockerized applicatons that cannot use env-variables directly can use this as an init-container

Usage

Pass the output file as env-variable

docker run -i --rm -e OUTPUT=/tmp/out.json -v /tmp/out:/tmp -e APP_var1=val1 -e APP_var2=val2 env2json

will produce

{
  "APP_var1": "val1",
  "APP_var2": "val2"
}

It is also possible to pass the prefix as env-variable

docker run -i --rm -e OUTPUT=/tmp/out.json -v /tmp/out:/tmp -e NGX_var1=val1 -e NGX_var2=val2 -e PREFIX=NGX_ env2json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published