Run from Docker Hub
You can run this image directly from Docker hub. This image does not include a
default configuration for vault, so you need to mount it yourself as a volume.
An example vault.hcl file is included in the Github repo.
In this example I made an explicit port mapping, but obviously you could automap
-P) as well.
Out of the box Vault needs to be able to do some memory paging which
is not allowed in Docker by default. This is why we need the
(also see this issue). If you
don't want to provide the container this capacity you can disable Vault from
using this feature by configuring
disable_mlock = true (see:
however this is not recommended in production.
docker run -d -p 8200:8200 -v $(pwd)/vault.hcl:/etc/vault.hcl --cap-add IPC_LOCK --name vault bjwschaap/vault
Build from source
Clone the repo:
git clone https://github.com/bjwschaap/docker-vault.git cd docker-vault
Build the image:
docker build -t [yourname]/vault .
And run it:
docker run -d -p 8200:8200 -v $(pwd)/vault.hcl:/etc/vault.hcl --cap-add IPC_LOCK --name vault [yourname]/vault
I will not document how to use Vault, since very good documentation is provided
by Hashicorp on the Vault website.
This is a good starting
Contributions are always welcome! Just file an
issue on Github and create
a pull request.