简体   繁体   English

如何在 ArangoDB docker 映像中指定配置文件?

[英]How can I specify a configuration file in ArangoDB docker image?

I'm trying to spin up an ArangoDB server via docker compose.我正在尝试通过 docker compose 启动 ArangoDB 服务器。

It all works out fine with default configuration, but I'm struggling to make the server in the container pick up a custom configuration file with minimal setup使用默认配置一切正常,但我正在努力让容器中的服务器以最少的设置获取自定义配置文件

I've tried with overriding the startup sequence with the following:我尝试使用以下内容覆盖启动序列:

command: >
    arangod --configuration /arango.conf

I've checked and the file is present in the container, but when I check the configuration file via query through arangoshell it still references the default settings and the arangod.conf file placed in the /tmp folder.我已经检查过并且该文件存在于容器中,但是当我通过 arangoshell 查询检查配置文件时,它仍然引用默认设置和放置在/tmp文件夹中的arangod.conf文件。

Any hints?有什么提示吗?

--config /tmp/arangod.conf is hardcoded in docker-entrypoint.sh at line 185 --config /tmp/arangod.confdocker-entrypoint.sh 第 185 行硬编码

it is also overwritten upon every start of container with /etc/arangodb3/arangod.conf at line 42每次启动容器时,它也会被第 42 行/etc/arangodb3/arangod.conf覆盖

so to run arangod with your custom.conf file you need map it as volume to /etc/arangodb3/arangod.conf因此,要使用您的custom.conf文件运行 arangod,您需要 map 将其作为/etc/arangodb3/arangod.conf的卷

via docker compose通过 docker 组成

volumes:
  /custom.conf:/etc/arangodb3/arangod.conf

via docker cli通过 docker cli

-v /custom.conf:/etc/arangodb3/arangod.conf

UPDATE: as per comments更新:根据评论

custom.conf have to contain defaults from /etc/arangodb3/arangod.conf custom.conf必须包含来自/etc/arangodb3/arangod.conf的默认值

easiest way is to save default config to custom.conf via docker cli and add/update options in that file最简单的方法是通过 docker cli 将默认配置保存到custom.conf并在该文件中添加/更新选项

docker run --rm arangodb/arangodb:3.7.5 sh -c 'cat /etc/arangodb3/arangod.conf' > custom.conf

it gonna be also required to track updates of default options in /etc/arangodb3/arangod.conf in new versions of ArangoDB and reflect them in your custom.conf它还需要在新版本的 ArangoDB 中跟踪/etc/arangodb3/arangod.conf中默认选项的更新,并将它们反映在您的custom.conf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM