Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Windows上的Docker容器中运行Artifactory_Windows_Docker_Artifactory - Fatal编程技术网

在Windows上的Docker容器中运行Artifactory

在Windows上的Docker容器中运行Artifactory,windows,docker,artifactory,Windows,Docker,Artifactory,我正在尝试在笔记本电脑上的Windows10本地运行Docker容器中的Artifactory。但是,当我使用以下命令启动docker容器时: docker run——名称artifactory-v$env:JFROG_HOME/artifactory/var/:/var/opt/JFROG/artifactory-d-p 8081:8081-p 8082:8082 docker.bintray.io/JFROG/artifactory cpp ce:latest 我尝试访问: ,我最终得到:

我正在尝试在笔记本电脑上的Windows10本地运行Docker容器中的Artifactory。但是,当我使用以下命令启动docker容器时:

docker run——名称artifactory-v$env:JFROG_HOME/artifactory/var/:/var/opt/JFROG/artifactory-d-p 8081:8081-p 8082:8082 docker.bintray.io/JFROG/artifactory cpp ce:latest

我尝试访问: ,我最终得到:

{
  "errors" : [ {
    "status" : 500,
    "message" : "Artifactory failed to initialize: check Artifactory logs for errors."
  } ]
}
system.yaml的内容是:

configVersion: 1
shared:
    node:
        id: 192.168.17.1
        ip: 192.168.17.1
和日志:

2020-09-08T20:49:29.438Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [ifactoryApplicationContext:558] [art-init            ] - Artifactory application context set to NOT READY by refresh
2020-09-08T20:49:33.231Z [jfrt ] [WARN ] [ee3f97d86edfcb96] [c.z.h.u.DriverDataSource:70   ] [art-init            ] - Registered driver with driverClassName=org.apache.derby.jdbc.EmbeddedDriver was not found, trying direct instantiation.
2020-09-08T20:49:33.266Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.a.s.d.v.DerbyValidator:26   ] [art-init            ] - Validating connection collation for derby database
2020-09-08T20:49:34.537Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [ritiesStorageServiceFactory:25] [art-init            ] - Initializing DB-based Priorities Storage Service
2020-09-08T20:49:35.945Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [actorySchedulerFactoryBean:727] [art-init            ] - Starting Quartz Scheduler now
2020-09-08T20:49:36.004Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [ifactoryApplicationContext:280] [art-init            ] - Artifactory context starting up 47 Spring Beans...
2020-09-08T20:49:36.287Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.a.s.a.AccessServiceImpl:459 ] [art-init            ] - Initialized new service id: jfrt@01ehqnp119ag0r0mzvsm9j12dh
2020-09-08T20:49:36.323Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [oryAccessClientConfigStore:608] [art-init            ] - Using Access Server URL: http://localhost:8046/access source: System Config
2020-09-08T20:49:38.191Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.j.c.ExecutionUtils:142      ] [pool-23-thread-1    ] - Cluster join: Retry 5: Service registry ping failed, will retry. Error while trying to connect to service registry (status = 404). Please review router request log for additional information
2020-09-08T20:49:43.203Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.j.c.ExecutionUtils:142      ] [pool-23-thread-2    ] - Cluster join: Retry 10: Service registry ping failed, will retry. Error while trying to connect to service registry (status = 404). Please review router request log for additional information
2020-09-08T20:49:48.214Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.j.c.ExecutionUtils:142      ] [pool-23-thread-1    ] - Cluster join: Retry 15: Service registry ping failed, will retry. Error while trying to connect to service registry (status = 404). Please review router request log for additional information
...
2020-09-08T20:50:58.371Z [jfrt ] [INFO ] [ee3f97d86edfcb96] [o.j.c.ExecutionUtils:142      ] [pool-23-thread-1    ] - Cluster join: Retry 85: Service registry ping failed, will retry. Error while trying to connect to service registry (status = 404). Please review router request log for additional information
2020-09-08T20:51:03.382Z [jfrt ] [ERROR] [ee3f97d86edfcb96] [o.j.c.ExecutionUtils:155      ] [pool-23-thread-2    ] - Cluster join: Service registry ping failed; Error while trying to connect to service registry (status = 404). Please review router request log for additional information
2020-09-08T20:51:03.390Z [jfrt ] [ERROR] [ee3f97d86edfcb96] [ctoryContextConfigListener:126] [art-init            ] - Application could not be initialized: HTTP response status 404:Failed on executing /api/v1/system/ping, with response: Not Found
不确定为什么在以下日志中看到localhost:

Using Access Server URL: http://localhost:8046/access source: System Config

为什么不使用192.168.17.1,即system.yaml中配置的地址?

我不确定为什么我的设置中不断收到404错误,但我认为这与文件权限有关。JFrog建议我们执行以下命令来运行Docker容器:

mkdir -p $JFROG_HOME/artifactory/var/etc/
cd $JFROG_HOME/artifactory/var/etc/
touch ./system.yaml
chown -R 1030:1030 $JFROG_HOME/artifactory/var
chmod -R 777 $JFROG_HOME/artifactory/var
然后使用以下命令运行容器:

docker run --name artifactory -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8081:8081 -p 8082:8082 docker.bintray.io/jfrog/artifactory-<pro|oss|cpp-ce>:latest
docker-run--name artifactory-v$JFROG_HOME/artifactory/var/:/var/opt/JFROG/artifactory-d-p 8081:8081-p 8082:8082 docker.bintray.io/JFROG/artifactory-:latest
但是,由于我正在Windows上运行容器,因此无法使用touch、chown和chmod执行文件权限设置。这似乎是Artifactory无法在我的设置上工作的原因。当我在没有-v选项的情况下启动Docker容器时,我可以连接到访问URL地址的Artifactory web应用程序http://localhost:8081/artifactory.


我不确定是否有办法在Windows上设置文件权限,以便能够使用-v选项启动容器。

上有一个更简单的方法,它使用适当的docker卷,而不是装载目录。以下是三个必要步骤:

docker volume create artifactory-data
docker pull releases-docker.jfrog.io/jfrog/artifactory-oss:latest
docker run -d --name artifactory -p 8082:8082 -p 8081:8081 -v artifactory-data:/var/opt/jfrog/artifactory releases-docker.jfrog.io/jfrog/artifactory-oss:latest

当Artifactory完成启动时(需要一段时间),遵循。

可以尝试使用docker命令“docker exec-u root-it artifactory chown artifactory:artifactory-R/var/opt/jfrog/artifactory”和“docker exec-u root-it artifactory chmod-R 777/var/opt/jfrog/artifactory”设置权限,但这并不能完全解决问题。