docker-compose 给出"error loading configuration from vault.json"错误



我试图在Spring Boot应用程序中使用Vault,并创建了以下docker-compose和Vault。json文件。

version: '3.8'
services:
vault:
container_name: vault
image: vault
restart: always
environment:
VAULT_ADDR: http://127.0.0.1:8200
entrypoint: vault server -config=/vault.json
ports:
- '8200:8200'
volumes:
- ./volumes/logs:/vault/logs
- ./volumes/file:/vault/file
- ./volumes/config:/vault/config
cap_add:
- IPC_LOCK
{
"backend": {
"file": {
"path": "/vault/file"
}
},
"listener": {
"tcp": {
"address": "0.0.0.0:8200",
"tls_disable": 1
}
},
"ui": true,
"disable_mlock": true
}

并将它们保持在同一目录下,并尝试在该目录下使用bashcmd运行以下命令:

docker-compose up --build

但是它给出了以下消息和错误:

[+] Running 1/1集装箱仓库重新创建0.1s连接到仓库Vault |从Vault加载配置错误。Json:统计仓库。Json: no such file or directory

我在entrypoint: vault server -config=/vault.json线上尝试了许多组合,但仍然是同样的问题。如何解决?

您需要在volume部分添加vault.json

volumes:
- ./vault.json:/vault.json

您的撰写文件应该更改为:

version: '3.8'
services:
vault:
container_name: vault
image: vault
restart: always
environment:
VAULT_ADDR: http://127.0.0.1:8200
entrypoint: vault server -config=/vault.json
ports:
- '8200:8200'
volumes:
- ./volumes/logs:/vault/logs
- ./volumes/file:/vault/file
- ./volumes/config:/vault/config
- ./vault.json:/vault.json
cap_add:
- IPC_LOCK

相关内容

  • 没有找到相关文章

最新更新