Minimal Dockerfile with habitat


#1

If I want to build containers with a custom mix of habby things going on, what’s the closest thing to FROM scratch I could start a Dockerfile with and then run hab commands. Is there an officially maintained base image that just comes with the hab command and minimal else? I know there’s one for studios but that comes with busybox and some binlinks already


#2

I’m not aware of a more minimal Dockerfile than the one that supports studios. Since the supervisor depends on busybox, you’re not going to be able to use habitat without that, so I don’t think it’s possible to get much more minimal.


#3

I don’t know if I would call this officially supported since it’s not in our build pipeline (yet) but I did make this a few weeks ago: https://github.com/habitat-sh/habitat/blob/master/components/rootless_studio/default/Dockerfile. The dockerfile it’s referencing at the top is https://github.com/habitat-sh/habitat/blob/master/components/rootless_studio/Dockerfile


#4

Will that work for running services, @elliott-davis? I’m curious how it gets around including the supervisor’s dependencies.


#5

No, it just has the hab binary. I don’ think @chris wanted the supervisor, just the static hab binary.


#6

Oh, in that case, awesome! Thanks for sharing that.


#7

@elliott-davis perfect! Could you push hab-base to dockerhub? https://hub.docker.com/u/habitat/


#8

Yeah I’m AFK at the moment but I can push it up tomorrow.


#9

https://hub.docker.com/r/habitat/hab-base/tags/