加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 03:49:42 所属栏目:安全 来源:网络整理
导读:我正在按照这些说明运行一个神器容器:https://www.jfrog.com/confluence/display/RTF/Running+with+Docker 它工作和神器已启动并运行,但这样我就无法使用自己的主机目录作为容器卷进行链接.该指南说要使用 -v /var/opt/jfrog/artifactory/etc-v /var/opt/jf

我正在按照这些说明运行一个神器容器:https://www.jfrog.com/confluence/display/RTF/Running+with+Docker

它工作和神器已启动并运行,但这样我就无法使用自己的主机目录作为容器卷进行链接.该指南说要使用

-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

这应该意味着导出ARTIFACTORY_HOME = / var / opt / jfrog / artifactory尚未执行(无论您是否使用卷).

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

另见这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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读