Skip to content

Instantly share code, notes, and snippets.

@magmax
Created December 13, 2022 13:51
Show Gist options
  • Save magmax/ee53b853f6e55d8278af85fd1c751188 to your computer and use it in GitHub Desktop.
Save magmax/ee53b853f6e55d8278af85fd1c751188 to your computer and use it in GitHub Desktop.

Instructions

  1. Ensure config.hcl file is in config directory
  2. run docker compose up -d
  3. run docker compose exec vault chown -R vault:vault /vault
  4. run docker compose exec vault apk add curl
  5. run docker compose exec vault curl --request POST --data '{"secret_shares": 1, "secret_threshold": 1}' http://127.0.0.1:8200/v1/sys/init
  6. Save the output from the previous command, what should look like:
    {
      "keys": [
        "f62f3164946c7c72f2c64b663c6cd1b5f4eacc2638d81c36f8661d7316778385"
      ],
      "keys_base64": [
        "9i8xZJRsfHLyxktmPGzRtfTqzCY42Bw2+GYdcxZ3g4U="
      ],
      "root_token": "hvs.7hYxIGDTdT0Z1pw2tZFvOiKP"
      }
    
  7. go to http://localhost:8200
  8. use the part in the keys_base64 to unseal.
  9. in the next window, use the part in the root_token to enter.
  10. You are in!
ui = true
storage "file" {
path = "/vault/file"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 1
}
version: "3.3"
services:
vault:
image: vault
command: server
volumes:
- data:/vault
- ./config:/vault/config
ports:
- 8200:8200
cap_add:
- IPC_LOCK
volumes:
data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment