是否有任何优雅的方法将ssl证书添加到来自docker pull的图像?
我正在寻找一种简单且可重现的方法,将文件添加到/ etc/ssl/certs并运行update-ca-certificates.(这应该涵盖ubuntu和debian图像).
我在CoreOS上使用docker,而coreos机器信任所需的ssl证书,但docker容器显然只有默认值.
我已尝试使用docker run --entrypoint=/bin/bash然后添加证书并运行update-ca-certificates,但这似乎永久覆盖入口点.
我现在也想知道,/etc/ssl/certs从主机复制到容器上安装会更优雅吗?这样做会隐式地允许容器信任与主机相同的东西.
我正在使用令人讨厌的代理来解决所有问题:(.这会破坏SSL并使容器变得有点奇怪.
我正在尝试将 Docker 用于现有应用程序,但遇到以下问题。当 API 尝试从容器中获取 Identity Server 元数据时,它失败并显示以下内容:
web_api | System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://host.docker.internal:5500/.well-known/openid-configuration'.
web_api | ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://host.docker.internal:5500/.well-known/openid-configuration'.
web_api | ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
web_api | ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Run Code Online (Sandbox Code Playgroud)
这确实由主机浏览器确认(Chrome 中的认证错误)。
如果我使用 localhost 而不是 host.docker.internal 访问相同的元数据,它会按预期工作。
我已使用此处的说明来创建和信任身份服务器也使用的本地主机证书:
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p { password here }
dotnet dev-certs https …Run Code Online (Sandbox Code Playgroud)