0

I make a lot of use of OCI devcontainer features to quickly and easily install an up-to-date stack into devcontainers (more info in this blog post).

But I want my production containers to be built with the same stack (minus the development-specific stuff), and presently I have to manually maintain production dockerfiles to mimic the stack that my devcontainer features install anyway.

How can I build a generic dockerfile such that a specified set of devcontainer features get added to it?

I'm looking for something like

docker build --features my_features.json .

Is this possible?

This question is inspired by this post on the python-poetry repo where everyone in the world wants poetry installed to a different base image! A related but less specific question here.

thclark
  • 4,784
  • 3
  • 39
  • 65
  • 1
    Being a fan of distroless images and knowing how lazy I am, even if the feature you are looking for exists, I would definitely not use it. It sounds so tempting to use it to install the same stack at the beginning, but losing control on what would be installed on a production image as more features and versions I would depend on. – David May 30 '23 at 14:08
  • 1
    Yep, very good point David and well made. For me there's another side of that coin - the territory of very limited human resources maintaining a larger number of environments. It's worth tolerating the bloat in such a case! – thclark May 30 '23 at 14:30

0 Answers0