All Projects → docker-archive → infra-reefer

docker-archive / infra-reefer

Licence: other
Managing a stable environment in your container.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to infra-reefer

terraform-openvpn
A sample terraform setup for OpenVPN using Let's Encrypt and Certbot to generate certificates
Stars: ✭ 43 (+2.38%)
Mutual labels:  infrastructure
community-edition
Zebrunner is a Test Automation Management Tool
Stars: ✭ 171 (+307.14%)
Mutual labels:  infrastructure
dinivas
AWS, GCP alternative on premise. Dinivas manage your private Cloud (OpenStack) infrastructure by providing many features based on popular Open Source projects
Stars: ✭ 15 (-64.29%)
Mutual labels:  infrastructure
awsdtc
AWS Data Transfer Cost Explorer
Stars: ✭ 90 (+114.29%)
Mutual labels:  infrastructure
Motoro
Smart contracts for decentralized rentals of vehicles.
Stars: ✭ 96 (+128.57%)
Mutual labels:  infrastructure
mozilla-sprint-2018
DEPRECATED & Materials Moved: This sprint was to focus on brainstorming for the Joint Roadmap for Open Science Tools.
Stars: ✭ 24 (-42.86%)
Mutual labels:  infrastructure
infra
Infrastructure management for Google Cloud Platform
Stars: ✭ 14 (-66.67%)
Mutual labels:  infrastructure
provisionr
📦📦➡️🏛️ Provision a library of R packages
Stars: ✭ 26 (-38.1%)
Mutual labels:  infrastructure
infrastructure
This repo contains all information about machine maintenance.
Stars: ✭ 75 (+78.57%)
Mutual labels:  infrastructure
datagov-deploy
Main repository for the data.gov service
Stars: ✭ 156 (+271.43%)
Mutual labels:  infrastructure
infraform
Creating infrastructure and running applications using different platforms
Stars: ✭ 31 (-26.19%)
Mutual labels:  infrastructure
plumbing
This repo holds configuration for infrastructure used across the tektoncd org 🏗️
Stars: ✭ 41 (-2.38%)
Mutual labels:  infrastructure
formica
Simple Tool to deploy Cloudformation Templates
Stars: ✭ 60 (+42.86%)
Mutual labels:  infrastructure
devopsbookmarks.org
Website of devopsbookmarks.org
Stars: ✭ 14 (-66.67%)
Mutual labels:  infrastructure
server-instant-start
Spin up a fully configured Ubuntu/Debian-based web server in under 10 minutes with Nginx (w/ HTTPS), PHP FPM, Postfix, OpenDKIM, MySQL/MariaDB, PostgreSQL, and more. Deploy your web application too.
Stars: ✭ 17 (-59.52%)
Mutual labels:  infrastructure
servpeek
Introspective peek into your server guts
Stars: ✭ 30 (-28.57%)
Mutual labels:  infrastructure
cloudpods
A cloud-native open-source unified multi-cloud and hybrid-cloud platform. 开源、云原生的多云管理及混合云融合平台
Stars: ✭ 1,469 (+3397.62%)
Mutual labels:  infrastructure
convoy
Fast and Secure Webhooks Service.
Stars: ✭ 763 (+1716.67%)
Mutual labels:  infrastructure
awesome-open-mlops
The Fuzzy Labs guide to the universe of open source MLOps
Stars: ✭ 304 (+623.81%)
Mutual labels:  infrastructure
stein
A linter for config files with a customizable rule set
Stars: ✭ 92 (+119.05%)
Mutual labels:  infrastructure

Reefer

Managing a stable environment in your container.

refrigerated container

Reefer is used to render templates based on environment variables before exec'ing a given process.

This is useful to configure legacy applications by environment variables to support 12factor app like configs.

Example: nginx + ssl certificates on Docker

First we create a image with nginx and reefer using a Dockerfile like this:

FROM nginx
RUN  curl -L https://github.com/docker-infra/reefer/releases/download/v0.0.4/reefer.gz | \
     gunzip > /usr/bin/reefer && chmod a+x /usr/bin/reefer
COPY  templates /
ENTRYPOINT [ "/usr/bin/reefer", \
  "-t", "/templates/nginx.conf.tmpl:/etc/nginx/nginx.conf", \
  "-t", "/templates/cert.pem.tmpl:/etc/nginx/cert.pem", \
  "-t",  "/templates/key.pem.tmpl:/etc/nginx/key.pem", \
  "-t",  "/templates/htpasswd.tmpl:/etc/nginx/htpasswd", \
  "/usr/bin/nginx", "-g", "daemon off;"
]

The files in the templates/ directory would look something like this:

cert.pem.tmpl:

{{ .Env "TLS_CERT" }}

key.pem.tmpl:

{{ .Env "TLS_KEY" }}

nginx.conf.tmpl:

http {
  server {
    listen 443;
  
    ssl    on;
    ssl_certificate     /etc/nginx/cert.pem;
    ssl_certificate_key /etc/nginx/key.pem;
  
    server_name {{ .Env "DOMAIN" }};
    location / {
      auth_basic "secret";
      auth_basic_user_file /etc/nginx/htpasswd;

      root   /srv/www/htdocs;
      index  index.html;
    }
  }
}

htpasswd.tmpl:

alice:{{ .Env "PASS_ALICE" }}
bob:{{ .Env "PASS_BOB" }}

Now you can start the image like this:

$ docker run -e TLS_CERT=`cat your-cert.pem` -e TLS_KEY=`cat your-key.pem` \
  -e DOMAIN=example.com -e PASS_ALICE=foobar23 -e PASS_BOB=blafasel -p 443:443 your-image

Reefer will read the environment variables and render the templates. After that, it will exec() the remaining parameter (nginx -g daemon off; in this example).

Passing environment variable through to your application

By default, reefer will not "pass through" environment variables you set to the application it executes; they will be available for the templates, but not the application. Notable exceptions:

COLORS
DISPLAY
HOME
HOSTNAME
KRB5CCNAME
LS_COLORS
PATH
PS1
PS2
TZ
XAUTHORITY
XAUTHORIZATION

This is done for security reasons because one of the primary uses of reefer is to pass sensitive information (private keys, etc.) used in the generation of your templates. It is generally a good idea to not have these environment variables "floating around" in the container environment. If you would like to pass through environment variables to other applications in your container, you can specify individual environment variables to "keep" with -e like so:

ENTRYPOINT [ "/usr/bin/reefer", \
  "-t", "/templates/app.conf.tmpl:/app/etc/app.conf", \
  "-t", "/templates/cert.pem.tmpl:/app/certs/cert.pem", \
  "-t",  "/templates/key.pem.tmpl:/app/certs/key.pem", \
  "-e",  "IMPORTANT_CONFIG_VAR", \
  "/app/app"
]

You can pass ALL environment variables through with -E:

ENTRYPOINT [ "/usr/bin/reefer", \
  "-t", "/templates/app.conf.tmpl:/app/etc/app.conf", \
  "-E", \
  "/app/app"
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].