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

go mod download for faster Dockerfile #409

Merged
merged 5 commits into from Apr 27, 2020

Conversation

NissesSenap
Copy link
Contributor

go mod download will help to download all dependencies before coping over the code. This won't help allot in your local environment but if you run this in a CI/CD pipeline you will see a increase if you run the build multiple time at the same server due to docker caching.

Since go creates a bin and the COPY command sets the owner to the current user we don't have to do any chown until the bin is ready.
I assume that dockerhub should still be happy with the dockerfile since we are using USER in the final container.

I only did this update in one file, if you think this is a good idea i will do it in the rest of them.

Downloading all dependencies before ading the code.
This enabels the docker cache to do it's magic.
@NissesSenap
Copy link
Contributor Author

@integrii please have a look and see what you think.

@integrii
Copy link
Collaborator

integrii commented Apr 8, 2020

Looks fine to me as long as the build still works with this new Dockerfile. You're a real docker wizard!

Thank you for looking at Kuberhealthy so seriously. We appreciate all your contributions a lot.

Using the same logic as the rest.
Could still clean up this one a bit, no need to do the move for example.
To lazy to fix right now.
@NissesSenap
Copy link
Contributor Author

Thank, glad that I can help with something I feel comfortable doing.

I have updated the rest of the Dockerfiles and I hope I managed to get them all right.
I only had time to build kuberhealthy and daemonset but I will try the rest of them tonight.

@joshulyne
Copy link
Collaborator

I've also been able to test some of the Dockerfiles you changed, and they lgtm! Haven't been able to test all of them though -- will try and do that soon!

@integrii integrii merged commit 7f6c0cc into kuberhealthy:master Apr 27, 2020
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.

None yet

3 participants