How to use docker-compose to spin up a Vault instance backed by Consul.
I just updated this repository, which is based of ideas from: www.marcolancini.it/2017/blog-vault/
TODO: Fix Backup - it doesn't work for now
Note: In order to execute scripts/vault_get_secret.py
you first need to source env.sh
- assuming that you already imported the cert.
- Create certs:
SAN=IP.1:127.0.0.1 scripts/gen-crt.sh
- Install and import certs to both container and host:
scripts/install-certs.sh
- Uncomment the part in vault.hcl about certificates and comment
tls_disable
- Restart the container if not already restarted
- Start services:
docker-compose up
- Init vault:
./scripts/setup.sh
- When done:
docker-compose down
Data will be persisted in the _data
folder.
- Start services:
docker-compose up
- Unseal vault:
scripts/unseal.sh
- Start services:
docker-compose up
- Run backup:
scripts/backup.sh
- Stop services:
docker-compose down --volumes
- Clear persisted data:
scripts/clean.sh