0.1.0 • Published 7 years ago

get-docker-secret v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Get Docker Secret Build Status

get-docker-secret is a small library to simplify getting secrets from docker. This library accepts a name and looks for a file or env for the token. If given TOKEN as the name, it will first look for an env called TOKEN_FILE. If this env exists, it will return the content of the file.

If it doesn't exist, it will check for an env called TOKEN, and return it if it does.

To use this with swarm and docker secret, add the path to the secret as an environment variable. An example would be TOKEN_FILE=/run/secrets/token.

Install

npm install --save get-docker-secret

Usage

const getDockerSecret = require('get-docker-secret');
const secret = getDockerSecret('SECRET', 'default value');