Giter VIP home page Giter VIP logo

boot's Introduction

By Lorc, Delapouite & contributors

BOOT

BOOT is a utility that merges environment variables into (configuration) files. It is designed to pass environment variables to applications with static configuration files running inside Docker containers.

It is an alternative to overlaying the configuration file on the container on start up.

Simply:

  • add environment variable placeholders into the files
  • export environment variables with the required values
  • call boot passing the file names to be updated
  • launch your app

Getting Started

  1. Download the boot utility platform specific versions from here.

  2. Create a bootstrap file to merge the variables and launch the app like follows:

# start.sh
/app/boot /app/conf1 /app/conf2 ...
exec "$@"
  1. Copy boot and the configuration with placehoslders to the docker image

  2. Call the bootstrap script from the CMD line (mosquitto mqtt broker example):

CMD ["sh", "/app/start.sh", "/app/mosquitto", "-c", "/app/mosquitto.conf"]

Merging Vars

given the following test.cfg config file:

cfg1=${ENV_VAR_1}
# ADS2 is a default value
cfg2=${ENV_VAR_2:ASD2}
cfg3=${ENV_VAR_3}
cfg4=${ENV_VAR_4}

on the command line run:

# export environment variables
# note no variable ENV_VAR_2 is defined 
export ENV_VAR_1=AAA
export ENV_VAR_3=CCC
export ENV_VAR_4=DDD

# merge variables in the config file
./boot test.cfg

check the contents of the file:

cfg1=AAA
# merged default
cfg2=ASD2
cfg3=CCC
cfg4=DDD

NOTE: using "PWD" as environemtn variable is not allowed as it can retrieve the path of the current process in some OS.

If no variables are exported the execution will fail.

boot's People

Watchers

 avatar  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.