Docker Secrets
A Rust library to easily access Docker secrets.
Docker secrets are mounted into the container at /run/secrets. This library provides a simple interface to read them.
Installation
Add this to your Cargo.toml:
[]
= "0.2.0"
Usage
Get all secrets
Returns a list of secret names found in /run/secrets.
use get_list;
Get a specific secret
Reads the content of a specific secret.
use get;
Configuration
By default, the library looks for secrets in /run/secrets. You can override this path by setting the DOCKER_SECRETS_DIR environment variable. This is useful for local development and testing.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.