Skip to content
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

Golang Docker image size #90

Open
radu-matei opened this issue Jan 29, 2018 · 5 comments
Open

Golang Docker image size #90

radu-matei opened this issue Jan 29, 2018 · 5 comments

Comments

@radu-matei
Copy link
Contributor

radu-matei commented Jan 29, 2018

The size of the Golang Docker image is large, very large (this is for a very simple application, no dependencies):
screen shot 2018-01-29 at 17 17 21

This makes the pushing/pulling of the image take a significant amount of time - is there any area we might improve here?

(Is it the same with other languages?)

@srini85
Copy link
Contributor

srini85 commented Jan 29, 2018

Maybe due to initialising the go dep package?
Dockerfile has...

RUN go get -u github.com/golang/dep/cmd/dep

RUN dep init

If that is the case, maybe there could be a base metaparticle aci container base image to speed things up?

@radu-matei
Copy link
Contributor Author

radu-matei commented Jan 29, 2018

Well, it shouldn't really be like this, you shouldn't have separate images based on the runtime (?) - the resulting Docker image is large regardless of the runtime.

(And if you haven't already pushed the base image to the registry it won't matter - and it won't matter for pulls).

It feels like a multi-stage building should improve a bit (but this is just an uninformed opinion).

Regardless, the resulting image is much too large.

@radu-matei
Copy link
Contributor Author

Initial tackle of this in 16f7a30
Resulting Docker image now 46 MB, still to go on improvements :)

screen shot 2018-01-31 at 21 40 55

@bwoodhouse322
Copy link
Contributor

#131 Should be as efficient as we can make it, squashed all layers and pulling 2mb base image. Google have their "distroless" base images designed for maximum efficiency, but I'm not sure on the legitimacy of the images.

@bwoodhouse322
Copy link
Contributor

gotest
Got it to 6MB with help from @radu-matei

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

No branches or pull requests

3 participants