gpt4 book ai didi

docker - Windows docker 容器中的 jfrog-cli - x509 : certificate signed by unknown authority

转载 作者:行者123 更新时间:2023-12-02 18:14:42 27 4
gpt4 key购买 nike

我试图将构建 Artifactory 从 Windows docker 容器上传到我们托管的 Artifactory 。运行 docker build 时出现此错误 x509: certificate signed by unknown authority。我正在使用安装了 docker 的 Windows Server 2016 VM。我在服务器上有公司代理。我从 https://jfrog.com/getcli/ 下载了 jfrog.exe(jfrog 版本 1.20.2)到 Windows 虚拟机。然后将可执行文件jfrog.exe复制到windows docker容器中。在 windows docker 容器中安装/复制 jfrog-cli 是正确的方法吗? 我不确定缺少哪些证书?

下面是示例 dockerfile:

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:\tools\7-Zip\7z.exe a artifacts.dv.zip C:\buid\artifacts &&\
C:\tools\JFROG-CLI\jfrog rt config --url %ARTIFACTORY_WEBSITE% --user %ARTIFACTORY_USER% --apikey %APIKEY% &&\
C:\tools\JFROG-CLI\jfrog rt u "artifacts.dv.zip" %ARTIFACTORY_ROOT_PATH% --build-name=artifacts.dv --flat=false &&\
C:\tools\JFROG-CLI\jfrog rt bp artifacts.dv &&\

CMD cmd

最佳答案

您提到的 x509 错误似乎表明用于连接到 Artifactory 的证书(由 ARTIFACTORY_WEBSITE 变量指定)不受信任。如果你有证书,你可以将它们添加到你的 docker 容器中并将它们放在 .jfrog/security 文件夹中

复制自 here

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 命令

关于docker - Windows docker 容器中的 jfrog-cli - x509 : certificate signed by unknown authority,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53154796/

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