Skip to content

Tweak golang image #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 12, 2016
Merged

Conversation

friism
Copy link
Contributor

@friism friism commented Apr 11, 2016

I've tried to tweak this image to be more like the official go image. It'd be great to figure out how to fold it into the Docker library image repo (and that's for me/Docker to figure out).

The dependency on .NET is very bad, but I can't get performant downloads any other way. If fast, this would be ideal:

Invoke-WebRequest -UseBasicParsing -Method Get -Uri https://golang.org/dl/go1.6.windows-amd64.zip | Expand-Archive -DestinationPath c:\\

Bits-Transfer would be ok too, but moby/moby#21922

@friism
Copy link
Contributor Author

friism commented Apr 11, 2016

@StefanScherer
Copy link
Contributor

@friism Good catch, downloading the ZIP instead of the MSI results in much smaller Docker images (I've done some tests installing MongoDB in different ways some months ago).

A fast and easy way to download files really helps users to create Dockerfiles like on Linux. I prefer the wget shortcut in PowerShell as it is more readable and shorter. It's a shortcut for Invoke-WebRequest and sometimes really slow. Does anybody know how to tweak the download speed for that command?

If we improve the golang Docker image it should also contain some developer tools. With only golang inside it is rather useless as you can't install dependencies or build more complex applications in it.

A go get needs at least git and for private repos also ssh. That's why I also added Git for Windows in my golang Dockerfile.

The official golang 1.6 Dockerfile for Linux has the following tools installed on top of golang:

FROM buildpack-deps:jessie-scm to install git, ssh client, svn, bzr, mercurial
RUN "Download and install gcc and make"
RUN "Download and extract golang 1.6"

@lowenna
Copy link
Contributor

lowenna commented Apr 12, 2016

Ps is dreadfully slow at downloading. See dockerfile.windows for a MUCH faster way.

@friism
Copy link
Contributor Author

friism commented Apr 12, 2016

That uses .net webclient too. It's a bad dependency though, because the
dockerfile won't be portable to nano server or other places that don't have
.net

On Monday, April 11, 2016, John Howard notifications@github.com wrote:

Ps is dreadfully slow at downloading. See dockerfile.windows for a MUCH
faster way.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#195 (comment)

http://friism.com/
(650) 318-1051
Sapere aude

@neilpeterson
Copy link
Contributor

Michael is also using WebClient in this PR, thanks for the workaround. I will get around to updating the other samples.

From dockerfile.windows

  Function Download-File([string] $source, [string] $target) { \
   $wc = New-Object net.webclient; $wc.Downloadfile($source, $target) \
  } \

Would any of you have a solution that works with Nano Server. The ADD instruction will bring content down, but looking for a scripted way to install and cleanup. Invoke-Command does not work and the WebClient class is not present. I've found an HttpClient class but am having issues downloading files with it.

@neilpeterson neilpeterson merged commit b9c05fb into MicrosoftDocs:master Apr 12, 2016
@friism
Copy link
Contributor Author

friism commented Apr 19, 2016

@neilpeterson I'm continuing this work here: docker-library/golang#92

neilpeterson pushed a commit that referenced this pull request May 6, 2016
Fix the use of undefined $dockerData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants