Joseph Wahba
Joseph Wahba

Reputation: 750

Error checking seal status while connecting to Vault Docker

I'm trying to run vault docker in server mode as described here. This is the command I'm using to run vault

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

And this is the vault.json configuration file

storage "inmem" {}

listener "tcp" {
  address     = "127.0.0.1:8200"
  tls_disable = 1
}

disable_mlock = true

The container comes up successfully.

docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
55100205d2ab        vault               "docker-entrypoint..."   6 minutes ago       Up 6 minutes        8200/tcp            stoic_blackwell

However, when I try to execute

 docker exec stoic_blackwell vault status

I get the below error:

Error checking seal status: Get https://127.0.0.1:8200/v1/sys/seal-status: dial tcp 127.0.0.1:8200: connect: connection refused

There is a similar question here but unfortunately I couldn't figure out what I misconfigured.

Any suggestions please?

Upvotes: 1

Views: 3733

Answers (2)

kalairaj
kalairaj

Reputation: 11

Please try it with below command,

vault status -tls-skip-verify

Upvotes: 0

gic186
gic186

Reputation: 836

The VAULT_LOCAL_CONFIG parameter specifies the configuration of your Vault; using the {"backend": {"file": annotation you set a file backend as the storage one.

So, in VAULT_LOCAL_CONFIG you should directly include what you wrote in your configuration file (vault.json).

Sidenote: The configuration file that you wrote is in HCL language, not json.

Upvotes: 1

Related Questions