Skip to content

getsentry/envdir-plusplus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENVDIR++(1)

a good mashup of envdir + docker's env-file. Intended to be used as a docker entrypoint script like:

#!/usr/bin/envdir++ /bin/sh

This allows pointing envdir++ to a directory if docker compatible env-file's. See the example .env/ folder in this repository and test.sh scripts for examples of how this works.

Intended use case is pairing Vault Agent with Kubernetes, were Vault Agent runs as an initContainer, spits out secrets as files into /vault/secrets/*. This then reads those files and elevates them into environment variables so your application can access them.

Add to your Dockerfile:

FROM alpine

ENV ENVDIR_VERSION v0.4.0
RUN set -eux; \
    \
    apk add --no-cache --virtual .build-deps \
        gnupg \
        wget \
    ; \
    wget -O /usr/bin/envdir++ "https://github.com/mattrobenolt/envdir-plusplus/releases/download/$ENVDIR_VERSION/envdir++-linux-amd64"; \
    wget -O /usr/bin/envdir++.asc "https://github.com/mattrobenolt/envdir-plusplus/releases/download/$ENVDIR_VERSION/envdir++-linux-amd64.asc"; \
    export GNUPGHOME="$(mktemp -d)"; \
    gpg --keyserver ha.pool.sks-keyservers.net --recv-keys D8749766A66DD714236A932C3B2D400CE5BBCA60; \
    gpg --batch --verify /usr/bin/envdir++.asc /usr/bin/envdir++; \
    rm -rf "$GNUPGHOME" /usr/bin/envdir++.asc; \
    chmod +x /usr/bin/envdir++; \
    envdir++ /bin/sh -c 'echo ok'; \
    apk del --no-network .build-deps

About

kinda like envdir, kinda like dotenv, kinda like docker env-file

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.8%
  • Dockerfile 3.3%
  • Makefile 2.5%
  • Shell 0.4%