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

Using cache when building the image #8

Open
ondrej-fabry opened this issue Feb 1, 2018 · 7 comments
Open

Using cache when building the image #8

ondrej-fabry opened this issue Feb 1, 2018 · 7 comments

Comments

@ondrej-fabry
Copy link
Contributor

ondrej-fabry commented Feb 1, 2018

The Dockerfile seems to be split into two RUN instructions to make use of caching, hence the git clone in first and git pull in second. However build script currently uses --no-cache flag so it won't use the cache.

Any reason for this?

@unclejack
Copy link
Contributor

@ondrej-fabry: That would avoid any potential caching of image. This should avoid using an outdated previously built image as that would be a bad thing.

@ondrej-fabry
Copy link
Contributor Author

ondrej-fabry commented Feb 1, 2018

Not sure I follow. Why would it be a bad thing to cache first RUN instruction if the other one will executed
on change of VPP_COMMIT anyway.

@unclejack
Copy link
Contributor

That's not the only time when the cache needs to be busted. The cache needs to be busted when any relevant packages are updated. Having built an image some months ago and using that cache isn't OK.

@ondrej-fabry
Copy link
Contributor Author

Okay, I see your point now. However currently the cache will be always busted when using build script, right?

@unclejack
Copy link
Contributor

We can set up a different build target to be used only for development which doesn't bust the cache.

@ondrej-fabry
Copy link
Contributor Author

ondrej-fabry commented Feb 1, 2018

That sounds like good idea. It would provide both options and default could be busting the cache.

@tiewei
Copy link
Contributor

tiewei commented Feb 1, 2018

This is mainly to make sure docker cloud doesn't have busted cache.
The make target currently reuse the codes, we can make it refer from env var if we want

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