gpt4 book ai didi

docker - 如何在 docker artifactory 容器中使用自己定位的文件夹作为卷?

转载 作者:行者123 更新时间:2023-12-04 20:36:44 25 4
gpt4 key购买 nike

我正在按照以下说明运行 Artifactory 容器:https://www.jfrog.com/confluence/display/RTF/Running+with+Docker

它可以工作并且 artifactory 已启动并正在运行,但这样我就无法使用我自己的主机目录作为容器卷进行链接。指南说使用

-v /var/opt/jfrog/artifactory/etc
-v /var/opt/jfrog/artifactory/data
-v /var/opt/jfrog/artifactory/backup
-v /var/opt/jfrog/artifactory/logs

运行容器时的选项,但通过这种方式,我获得了卷存储在一些/var/lib/docker/volumes/.. 子文件夹中。我想要的是将这些卷安装在例如我主机的/opt/artifactory/

所以我尝试以这种方式使用卷映射:
-v /opt/artifactory/etc:/var/opt/jfrog/artifactory/etc
-v /opt/artifactory/data:/var/opt/jfrog/artifactory/data
-v /opt/artifactory/backup:/var/opt/jfrog/artifactory/backup
-v /opt/artifactory/logs:/var/opt/jfrog/artifactory/logs

但我收到此错误:
** ERROR: Artifactory home folder not defined or does not exists at

有没有人以前试过这个?我该如何管理?

谢谢,
米歇尔。

最佳答案

Artifactory home folder not defined or does not exists at



那应该是 export ARTIFACTORY_HOME=/var/opt/jfrog/artifactory尚未执行(无论您是否使用卷)。

这也意味着你应该执行 docker run-e ARTIFACTORY_HOME=/var/opt/jfrog/artifactory环境选项。

另见此 support thread .

OP Mikyjpeg添加 in the comments :

I eventually found the problem:
There is a file in the /var/opt/jfrog/artifactory/etc folder of the container that sets all the environment variables. This file is erased by the volume mapping (as it does not exist on my host), it is recreated when the command starts but with a different content.
So I have copied this file from a working container, put into my host etc mapped volume and run again. And now it works.

I was supposing that the -v option creates empty volumes in either cases but now I know that it is not true.

关于docker - 如何在 docker artifactory 容器中使用自己定位的文件夹作为卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33755350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com