Code Monkey home page Code Monkey logo

docker-scaffold's Introduction

Scaffold docker image

This project is to be used as base for minimal container images with embedded configuration template mechanism.

The output of the project is just 11Mb as it is based on Alpine image.

Build Image

Use captain:

$ captain build

or docker

$ docker build -t `whoami`/docker-scaffold .

Use Image

$ docker run `whoami`/docker-scaffold
OBLIGATORY_VAR variable is not provided, exiting...

If you run it directly it will show an example of validation of an obligatory variable.

To run it properly do:

$ docker run -e OBLIGATORY_VAR=sample `whoami`/docker-scaffold
Generating app.properties...
id=000001                 # Variable with default value
optional=     # Optional variable, returns empty if not defined
obligatory=sample # Obligatory variable, validation fails and script stops

To add value to the optional variable do:

$ docker run -e OPTIONAL_VAR=sample2 -e OBLIGATORY_VAR=sample `whoami`/docker-scaffold
Generating app.properties...
id=000001                 # Variable with default value
optional=sample2     # Optional variable, returns empty if not defined
obligatory=sample # Obligatory variable, validation fails and script stops

To override the default value for id do:

$ docker run -e APP_ID=101 -e OBLIGATORY_VAR=sample `whoami`/docker-scaffold
Generating app.properties...
id=101                 # Variable with default value
optional=     # Optional variable, returns empty if not defined
obligatory=sample # Obligatory variable, validation fails and script stops

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.