我试图将构建工件从windows docker容器上传到我们托管的artifactory。在运行docker构建时,我得到了这个错误x509: certificate signed by unknown authority
。我使用的是安装了docker的Windows服务器2016虚拟机。我在服务器上有公司代理。我从以下位置下载了jfrog.exe(jfrog版本1.20.2(https://jfrog.com/getcli/到Windows虚拟机。然后将可执行文件jfrog.exe复制到windows docker contaier中。在windows docker容器中安装/复制jfrog-cli是正确的方法吗?我不确定缺少什么证书?
以下是示例码头文件:
FROM docker_registry/deploytools as deploy
ARG ARTIFACTORY_WEBSITE="https://.../artifactory"
ARG ARTIFACTORY_USER=""
ARG ARTIFACTORY_APIKEY=""
ARG ARTIFACTORY_ROOT_PATH=""
WORKDIR C:\build
SHELL ["cmd", "/S", "/C"]
RUN echo "Deploying artifacts...." &&
C:tools7-Zip7z.exe a artifacts.dv.zip C:buidartifacts &&
C:toolsJFROG-CLIjfrog rt config --url %ARTIFACTORY_WEBSITE% --user %ARTIFACTORY_USER% --apikey %APIKEY% &&
C:toolsJFROG-CLIjfrog rt u "artifacts.dv.zip" %ARTIFACTORY_ROOT_PATH% --build-name=artifacts.dv --flat=false &&
C:toolsJFROG-CLIjfrog rt bp artifacts.dv &&
CMD cmd
您提到的x509错误似乎表明用于连接到Artifactory的证书(由ARTIFACTORY_WEBSITE
变量指定(不受信任。如果您有证书,您可以将它们添加到docker容器中,并将它们放置在.jfrog/security
文件夹中
从这里复制
JFrog CLI supports accessing Artifactory over SSL using self-signed certificates as follows:
Under your user home directory, you should find a directory named .jfrog (this directory is created by the JFrog CLI first time it is used).
Under .jfrog, create a directory called security
Place your SSL certificate in your ~/.jfrog/security directory
要在构建镜像期间将它们添加到docker镜像中,可以在Dockerfile 中使用ADD
命令