Select Page

The HashiCorp Vault binary can be accessed without polluting the host binary environment by using Vault within a Docker container.

By using a Bash function we can pass arguments into a single-run Docker command:

# Vault Docker single-run command alias

docker run --rm --cap-add IPC_LOCK vault $1

alias vault=vault_run

After adding this to ~/.bash_profile and running source ~/.bash_profile you should be able to execute vault as you would normally expect out of a binary!

~ vault -v
Vault v0.9.5 ('36edb4d42380d89a897e7f633046423240b710d9')