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

Caching of requirements.txt #136

Merged
merged 1 commit into from
Jun 12, 2019
Merged

Caching of requirements.txt #136

merged 1 commit into from
Jun 12, 2019

Conversation

cimnine
Copy link
Collaborator

@cimnine cimnine commented May 22, 2019

After a discussion with @rje6459 on the networktocode Slack
in the #netbox-docker channel we've come up with a small improvement
to those that regularly have to build netbox Docker images locally.

It basically fetches the "requirements.txt" from the desired branch before downloading netbox itself.

After [a discussion][1] with rje6459 on the networktocode Slack
in the #netbox-docker channel we've come up with a small improvement
to those that regularly have to build netbox docker locally.

It fetches the "requirements.txt" from the desired branch before
downloading netbox itself.

[1]: https://networktocode.slack.com/archives/CD23LP8BC/p1558537080023200
Copy link
Contributor

@robellegate robellegate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying my response from #netbox-docker channel on networktocode.slack.com:

Works well. I've looked into how the ADD instruction works and it seems that it will only invalidate it's cache if the source file changes, which is good for utilizing the Docker cache for build speed. One problem I'm still thinking of is the best way to invalidate the cache for the RUN instruction for wgetting netbox itself.

Could something like this work?
https://stackoverflow.com/a/39278224/7803239

Put it after the RUN instruction for pip install and the RUN instruction for wget?

I've submitted my own PR implementing this change #137
Edit: Didn't realize I could propose code changes w/o a separate PR

@cimnine cimnine merged commit 821fb5f into master Jun 12, 2019
@cimnine cimnine deleted the improved_build_speed branch June 12, 2019 16:04
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

2 participants