How to Deploy Hashicorp Vault Container?

Hi All,

I have one task and i’m not understand how can i do it…if anyone knows please help with clear steps so that i can easily do it

Here is the one by one task to do…

  1. Deploy a Hashicorp Opensource Vault container ===> DONE
  2. Using CLI or UI add username/password of Test App ===> DONE
  3. Using Vault API with Token retrieve Test app’s username/password using @Cmd ===> PENDING
  4. Next call another Test App’s token generation apis with the credentials ===> PENDING

And after searching in google i have done little bit till here…

after that i dont know how to do it…

  • Using Vault API with Token retrieve Test app’s username/password using @Cmd
  • Next call another Test App’s token generation apis with the credentials

Please let me know…

Hi @rashidmd777 ,

you could execute a bash script in the CMD section of your Docker image.

This script could use curl to retrieve the credentials from Vault.

The curl call would look something like this:


curl --header "X-Vault-Token: $VAULT_TOKEN" --request GET $VAULT_ADDR/v1/kv/data/Test

The Vault token and address can be passed as environment variables at container creation time.

The API docs for the Vault endpoint used can be found here: KV - Secrets Engines - HTTP API | Vault by HashiCorp

You can parse NBP and NBU from the response.

Good luck

Nick

1 Like

@Nick-Triller Thanks for quick reply

I have just try from cmd and below is the screenshot

but i have do completed this 2 points just tell me…how can i do it
3. Using Vault API with Token retrieve Test app’s username/password using @Cmd ===> PENDING
4. Next call another Test App’s token generation apis with the credentials ===> PENDING

If 3 point is completed which u have seen above screenshot then plse tell me what 4th point

And tell me what i need to make changes in dockerfile, docker-compose file or vault-config.json

Let me know