Docker and Vault: a preliminary tutorial

We most likely heard about Docker, the ultimate container. Recently I followed the GSG on the official website to get a feel for it. Vault is a open source project supported by Hashi Corp (famous for Vagrant, Consul, and other open source projects). I came across this docker vault image created by kintoandar (Joel Bastos) via his blog post Vault: PKI Made Easy. Since I was new to both technologies (I did followed the docker GSG on my Mac), Joel’s blog is a bit advanced for me, here are some of the steps I did to make the basic vault commands work.

I will update this blog post as I follow along the offical Vault GSG and Joel’s blog post.

Start the docker terminal, click the docker.app on Mac, it should lanuch the terminal.


docker pull kintoandar/hashicorp-vault

docker run -d -p 8300:8300 kintoandar/hashicorp-vault

docker help

Minjies-MacBook-Pro:sandbox minjiexu$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c8b183b9e0ed kintoandar/hashicorp-vault "/bin/vault server -c" About an hour ago Up About an hour 0.0.0.0:8300->8300/tcp admiring_jang

Minjies-MacBook-Pro:sandbox minjiexu$ docker logs c8b183b9e0ed (this is the container_id above)

Minjies-MacBook-Pro:sandbox minjiexu$ docker inspect c8b183b9e0ed

Minjies-MacBook-Pro:sandbox minjiexu$ docker exec c8b183b9e0ed vault status -address http://172.17.0.2:8300 (one line)

Sealed: false
Key Shares: 1
Key Threshold: 1
Unseal Progress: 0

High-Availability Enabled: false