Docker hub的Dockerfile-包括命令中的repo文件(ssl证书)
我正在尝试向自定义docker映像添加SSL支持。这是我的Dockerfile:Docker hub的Dockerfile-包括命令中的repo文件(ssl证书),docker,Docker,我正在尝试向自定义docker映像添加SSL支持。这是我的Dockerfile: FROM selenium/standalone-chrome-debug:3.141.59-yttrium # Switch to root user USER root # Add SSL support for stripe # https://docs.lando.dev/config/security.html#certificates RUN cp lndo.site.pem lndo.site.c
FROM selenium/standalone-chrome-debug:3.141.59-yttrium
# Switch to root user
USER root
# Add SSL support for stripe
# https://docs.lando.dev/config/security.html#certificates
RUN cp lndo.site.pem lndo.site.crt /usr/local/share/ca-certificates
RUN update-ca-certificates
但是,这会导致生成失败:
Step 4/5 : RUN cp lndo.site.pem lndo.site.crt /usr/local/share/ca-certificates
---> Running in 112093a612fe
[91mcp: cannot stat 'lndo.site.pem': No such file or directory
cp: cannot stat 'lndo.site.crt': No such file or directory
文件lndo.site.pem
和lndo.site.crt
被提交到与我的Dockerfile相同的存储库中
我发现了,但我正试图为Docker Hub做同样的事情,所以我的问题不同
在Dockerfile中使用的repo中的文件的路径是什么
我用于在Docker Hub上构建映像的Github回购的结构:
- Dockerfile
- README.md
- lndo.site.crt
- lndo.site.pem
您确定该目录中存在lndo.site.pem和lndo.site.crt文件吗 在Dockerfile上,我看到一个命令:
RUN cp lndo.site.pm lndo.site.crt /usr/local/share/ca-certificates
您正在查找文件lndo.site.pem,但Dockerfile上可能缺少一个字符
lndo.site.pm -> lndo.site.pem
我想您应该确定您正在将证书文件复制到容器映像(在Dockerfile上)根据@ezileli的评论,我找到了解决方案:
FROM selenium/standalone-chrome-debug:3.141.59-yttrium
# Switch to root user
USER root
# Add SSL support for stripe
# https://docs.lando.dev/config/security.html#certificates
COPY lndo.site.pem lndo.site.crt /certs
RUN update-ca-certificates
谢谢,我修正了那个错误,但是我仍然会遇到同样的错误。我在问题中添加了更多关于Github回购协议结构的信息。问题是我不知道Dockerfile中我的Github repo中的文件使用哪条路径。好的,那么我建议您将此命令添加到上面的Dockerfile中
运行cp lndo.site.pem lndo.site.crt/usr/local/share/ca certificates
命令<代码>复制lndo.site.crt lndo.site.pem./