问题描述
我们在Nexus SonaType上托管了一个自定义的NuGet Feed。设置好了,我们为自己的存储库提供了一个提要,并为NuGet提供了一个“提要”。现在,我们也想在Docker中使用此供稿来自动运行测试,构建映像等。
由于我们拥有自己的证书,并且我们的服务位于代理之后,因此我在function fib1(n) {
if (n === 1) return 0;
if (n === 2) return 1;
return fib1(n - 1) + fib1(n - 2);
};
function fib2(n) {
return (() => {
if (n === 1) return 0;
if (n === 2) return 1;
return fib2(n - 1) + fib2(n - 2);
})();
};
function calculateAverageTime(func,iterations = 5) {
let sum = 0;
[...Array(iterations)].forEach(() => {
const start = new Date();
func();
const finish = new Date();
sum += (finish - start);
});
return Math.round(sum / iterations);
}
function compareByIterations(i) {
const fib1RunTime = calculateAverageTime(() => fib1(i));
const fib2RunTime = calculateAverageTime(() => fib2(i));
console.log(`Difference with ${i} iterations is ${(fib2RunTime - fib1RunTime) * 1000}ms`);
}
[10,20,30,40].forEach(i => compareByIterations(i));
Dockerfile
将两种服务作为源添加都可以正常工作,但是,一旦我想添加受信任的签名者,就会收到错误消息
ARG proxy
RUN dotnet nuget add source "https://sonatype-nexus.ourdomain.com/repository/releases/" --name "Digital Repository" --username "digital" --password $NUGET_USER_PASSWORD --store-password-in-clear-text
RUN dotnet nuget add source "https://sonatype-nexus.ourdomain.com/repository/nuget.org-proxy/" --name "NuGet Proxy"
RUN mono /usr/local/bin/nuget.exe config -set http_proxy="${proxy}"
RUN mono /usr/local/bin/nuget.exe trusted-signers add -Name "Digital Repository" -ServiceIndex "https://sonatype-nexus.ourdomain.com/repository/releases/index.json"
RUN mono /usr/local/bin/nuget.exe trusted-signers add -Name "NuGet Proxy" -ServiceIndex "https://sonatype-nexus.ourdomain.com/repository/nuget.org-proxy/index.json"
但是,当我取消评论时,只有Invalid certificate information from the service index 'https://sonatype-nexus.ourdomain.com/repository/releases/index.json'.
可用,它可以正常工作。只是一个失败了。
但是它们在同一个域中。一个怎么会因证书错误而失败,而另一个却不会失败?
更新
奇怪的是,两个nuget.org-proxy
的{{1}}都可以正常工作。实际上,只有证书才有问题:/
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)