Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clayrisser/envstamp
Make docker containers easily configurable with environment variables
https://github.com/clayrisser/envstamp
config configuration docker dockerfile env environment environment-variables template variables
Last synced: about 1 month ago
JSON representation
Make docker containers easily configurable with environment variables
- Host: GitHub
- URL: https://github.com/clayrisser/envstamp
- Owner: clayrisser
- License: mit
- Created: 2017-11-26T05:28:27.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T09:36:19.000Z (over 1 year ago)
- Last Synced: 2024-12-08T20:53:15.085Z (about 1 month ago)
- Topics: config, configuration, docker, dockerfile, env, environment, environment-variables, template, variables
- Language: Go
- Homepage: https://jam.jamrizzi.com
- Size: 881 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# envstamp
Make docker containers easily configurable with environment variables
![](assets/envstamp.png)
This was built to make it easier to modify config files in a docker
image using environment variables## Install
```sh
sudo curl -L -o /bin/envstamp https://github.com/jamrizzi/envstamp/releases/download/v0.2.0/envstamp
sudo chmod +x /bin/envstamp
```## Build
```sh
git clone https://github.com/jamrizzi/envstamp.git
make build
```## Usage
Assume you have the following template at `/my/custom/template.txt`
```
Hello ${WOLRD}
```Run the following . . .
```sh
export WOLRD=galaxy
envstamp /my/custom/template.txt
```All environment variables have been replaced in `/my/custom/template.txt`
```sh
cat /my/custom/template.txt# Hello galaxy
```To set a default value when an environment variable does not exist, use the following syntax
```
Hello ${WORLD:universe}
```