decidim / docker

Docker images for decidim
https://decidim.org
12 stars 18 forks source link

Use build version to allow skipping cache #11

Closed josepjaume closed 6 years ago

josepjaume commented 6 years ago

This introduces a FORCE_REBUILD_VERSION dummy echo to force rebuilding from that step on when we might need it.

It also ensures the docker image is build using --pull so we get the latest base ruby image in each rebuild.

deivid-rodriguez commented 6 years ago

Actually @josepjaume I think this was a false alarm, I completely removed the image to make sure that I download it fresh and now running docker run --rm -it decidim/decidim:latest-dev bash -c "bundle --version" or docker run --rm -t decidim/decidim:latest-dev bash -c "ls -la /tmp" works as expected.

Unless you manually pushed a fixed image or something, it seemed like a false alarm, sorry...

josepjaume commented 6 years ago

Nope, I didn't! Anyway, I've seen this method used in the past - It might be useful in some situations. Should we maybe merge this?

deivid-rodriguez commented 6 years ago

I've used the --no-cache option to docker build before. Is it equivalent to what we're doing here?

Regarding the --pull option, seems like a good thing to do!

josepjaume commented 6 years ago

Well, not exactly. The --cache will build the image from scratch every time, while this way we can choose when to increment the number to skip the cache. Having docker cache intermediate steps is good in the majority of situations, except when you want to run them again (newer versions, etc). But I see how it looks a bit weird... What to do? xD

deivid-rodriguez commented 6 years ago

Ah ah, I see how this env variable works now. I thought it was a boolean, but it's a counter!

Not sure what to do either, but it's nice to discover this trick :)

josepjaume commented 6 years ago

Let's close this, as there's no aparent benefit.