GithubHelp home page GithubHelp logo

kerfab / docker-entrypoint Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 3.0 50 KB

Production-ready entrypoint shell script for Docker, for launching one or more processes within a single docker container.

License: Apache License 2.0

Shell 100.00%

docker-entrypoint's Introduction

docker-entrypoint

Production-ready entrypoint shell script for Docker, for launching one or more processes within a single docker container.

It allows you to:

  • enforce and control the use of mandatory environment variables

  • define optional environment variables with default values

  • move files from a location to another for pre-start purposes

  • build template configuration files that will be rewritten pre-start with the content of your environment variables (requires a writeable /tmp in your container)

  • launch an unlimited number of processes, with optional sleep policy before starting specific processes

  • implement flexible Stop conditions on crashes or processes exits: kill all the other processes (gracefully or not), restart the crashed process, ignore, execute custom command, etc.

  • execute pre-start and post-start commands for additional setup processes with optional sleep policy again

  • implement a global stop policy, to gracefully handle external container termination (docker stop, CTRL+C, etc.)

  • flush an unlimited number files on stdout - Useful for lazy real time log extraction on stdout rather than trying to change application/servers configs to print on stdout. Warning: flushed files are truncated

  • have a RESET feature, allowing you to execute specific set of commands only when you define $RESET_CONTAINER in environment

  • handles arguments on docker run so that you can override the entrypoint (eg: to start a shell) - supports parameters.

  • internal detailed documentation explaining all the steps for exploiting the features

TODO (if you want to contribute):

  • conditional pre-start, entrypoint and post-start pipelines rather than sleep based executions
  • a support for executing specific processes under specific user ids
  • a rewrite of the file replacement feature which works but could be more elegant and could avoid using /tmp
  • more constants to permit an easier behavior edition on some features
  • alternative to flush-truncate with a tail

docker-entrypoint's People

Contributors

kerfab avatar

Watchers

James Cloos 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.