GithubHelp home page GithubHelp logo

shakahl / docker-configomat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alinmear/docker-configomat

0.0 0.0 0.0 14 KB

A simple shellscript to easily substitue config files based on env variables

License: MIT License

Shell 96.41% Makefile 3.59%

docker-configomat's Introduction

docker-configomat

Build Status Github Stars Github Forks Gitter

A simple shellscript to easily substitue config files based on env variables

This little project should make the configuration part of small docker projects easier.

NOTE:

  • For now you must have the bash shell installed. Especially alpine is using sh by default (apk add --no-update --no-cache bash).
  • key=value pairs without spaces are not supported at the moment (key = value is supported)

Logics

Just define an env prefix, the key and the value of a config file:

cat /etc/kopano/ical.cfg:

[...]
# File with RSA key for SSL
ssl_private_key_file = /ssl/key.pem

# File with certificate for SSL
ssl_certificate_file = /ssl/cert.pem

# Verify client certificate
ssl_verify_client = no
[...]
export LDAP_SSL_PRIVATE_KEY_FILE=/tmp/test.pem
export LDAP_SSL_VERIFY_CLIENT=yes
configomat.sh LDAP_ /etc/kopano/ical.cfg

Usage

configomat.sh <PREFIX> <FILE>
# or
configomat.sh <PREFIX> "<FILE1> <FILE2> <FILE3>"

Use within your docker project

  • Add subproject
cd <your-project>
git submodule add https://github.com/alinmear/docker-configomat.git
git commit
  • Extend your Dockerfile with theses lines
COPY docker-configomat/configomat.sh /usr/local/bin
RUN chmod +x /usr/local/bin/*

Now you can call the script within your other scripts like described above:

configomat.sh <PREFIX> <FILES>

docker-configomat's People

Contributors

alinmear avatar casperklein avatar dolanor avatar wernerfred avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.