A note when I'm addicted to using Docker Hub Vault in server mode

--Official site: https://hub.docker.com/_/vault

The following command in Running Vault in Server Mode failed to start a connectable container from the host.

docker run --cap-add=IPC_LOCK -e 'VAULT_LOCAL_CONFIG={"backend": {"file": {"path": "/vault/file"}}, "default_lease_ttl": "168h", "max_lease_ttl": "720h"}' vault server

--Resolved information: https://github.com/hashicorp/vault/issues/441#issuecomment-123362274

Point (I think it is, but if it is a recognition error, it is okay. I would appreciate it if you could point it out.)

--Disable TLS --Changed tcp address to 0.0.0.0:8200

Then, since the above command does not expose the container port, it is necessary to expose it to the host with the -p option. In addition, the following warning log was output with the above command.

[WARN]  no `api_addr` value specified in config or in VAULT_API_ADDR; falling back to detection if possible, but this value should be manually set

Therefore, you need to specify api_addr in VAULT_LOCAL_CONFIG or specify the Vault API address in VAULT_API_ADDR.

Based on the above, the final command example is as follows.

Command example when starting in server mode accessible from the host

docker run --cap-add=IPC_LOCK -e 'VAULT_LOCAL_CONFIG={"backend": {"file": {"path": "/vault/file"}}, "api_addr": "http://127.0.0.1:8200", "listener": {"tcp": {"address": "0.0.0.0:8200", "tls_disable": "true"}}}}' -p 8200:8200 vault server

that's all.

Recommended Posts

A note when I'm addicted to using Docker Hub Vault in server mode
A note when I was addicted to converting Ubuntu on WSL1 to WSL2
Things to note when using Spring AOP in Jersery resource classes
I summarized the points to note when using resources and resources in combination
When the server fails to start in Eclipse
A note when you want Tuple in Java
Push the image to docker hub using Jib
I tried to implement a server using Netty
I stumbled when I tried using neo4j in the jenv environment, so make a note
When executing in parallel with Java, I'm addicted to not paying attention to thread safety
Things to keep in mind when using if statements
A memorandum when trying to create a GUI using JavaFX
[Note] Build a Python3 environment with Docker in EC2
What I learned when building a server in Java
How to convert A to a and a to A using AND and OR in Java
Try to build a Java development environment using Docker
What to do when a could not find driver appears when connecting to a DB in a Docker environment
When there is no output to stdout in docker log
I want to find a relative path in a situation using Path
A story I was addicted to in Rails validation settings
I was addicted to using Java's Stream API in Scala
Things to keep in mind when using Sidekiq with Rails