Docker: golang image not building on WS 2016

polaris · · 492 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>We are building a Golang image on WS 2016, but we seem to have ran into compatibility issues. Here is the Dockerfile:</p> <p><a href="https://pastebin.com/QS8DyKYf" rel="nofollow">https://pastebin.com/QS8DyKYf</a></p> <p>After realizing Windows can&#39;t build Linux-based images (like Golang), we opted for</p> <p><strong>FROM golang:windowsservercore</strong></p> <p>instead, but now it gets hung indefinitely (in Powershell) on this line:</p> <p><strong>RUN go get .</strong></p> <p>. Any advice on this?</p> <hr/>**评论:**<br/><br/>tty5: <pre><p>add <code>-v</code> to <code>go get</code> and <code>go build</code> to get verbose output - it might offer some clue. </p></pre>opiniondevnull: <pre><p>I&#39;ve been using Chocolately to make Docker containers that can built windows images</p> <p>FROM microsoft/windowsservercore</p> <p>RUN powershell iex ((New-Object System.Net.WebClient).DownloadString(&#39;<a href="https://chocolatey.org/install.ps1&#39;)" rel="nofollow">https://chocolatey.org/install.ps1&#39;)</a>)</p> <p>RUN choco install git -y</p> <p>RUN choco install golang -y</p></pre>FrankTheSwag: <pre><p>Hey thanks for the reply, I reran with the modifications you suggested and this is what I come across:</p> <p>Step 1/10 : FROM golang:windowsservercore ---&gt; 1b648944b381 Step 2/10 : RUN powershell iex ((New-Object System.Net.WebClient).DownloadString(&#39;<a href="https://chocolatey.org/install.ps1&#39;)" rel="nofollow">https://chocolatey.org/install.ps1&#39;)</a>) ---&gt; Running in 569422c65e8f failed to create endpoint mystifying_darwin on network nat: hnsCall failed in Win32: The remote procedure call failed. (0x6be)</p> <p>The &#34;failed to create endpoint &#34; error was actually the same error I get on the </p> <p><strong>RUN go get .</strong></p> <p>line. So it might be a network issue after all...</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

492 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传