Should I install tools or create a custom build image?


#1

I was wondering if it would be faster to install tools that are go binaries via curl compared to building a custom image. I suppose it depends on whether you’re caching curl responses vs the last layer of a custom image.

Thoughts?


#2

It’s hard to answer in general, since it depend on how long something takes to install versus how long an image takes to pull. I tend to suggest starting with installing binaries first (since that’s easier to get running than custom build images) and then if you are dissatisfied with the build time, try building a custom image.

Of course if your custom image is 50M then it will probably be very fast, even if pulled from another data centre, but if it ends up Ubuntu-sized at 500M+, then maybe not :smile_cat:


#3

Well, all the CircleCI images are fat debian/ubuntu images as far as I could see. Since the layer would most like be cached I would just add the go binaries on top.

So IMO it’s mainly a question of how it’s being cached internally. Ideally, I want the feedback loop for the developer as fast as possible.


#4

Sure, but you can start from a small distro if you wish, like Alpine.

I’d go with installing tools on a default distro then. Maintaining your image takes a bit more work, since once you have pushed your changes to a repo, you still have to build it and push to a registry, and then re-run your dependent builds.


#5

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.