Exporting Habitat build to run in non container environments


Is it possible to export habitat builds to run in a bare metal server or a vm? Currently the only options I see for exporting are “aci”, docker and mesos.


Hello -

yes, definitely. The only requirements we have on Linux are a 64-bit processor with a kernel greater than 2.6.32. I’d love to see an example in our docs on this, I’ll make a note for the team.

You should be able to extract a hart file w/ the hab executable to /hab or some other directory with correctly patched glibc etc. See [0] for more info on how this works under the hood.

The export commands exist because Docker + Mesos have specific packaging requirements. The source for hab dockerize is a great place to start if you’re curious [1], and it’s quite short and to the point.

Cheers -

[0] https://github.com/habitat-sh/habitat/blob/master/components/core/src/crypto/mod.rs#L123-L191
[1] https://github.com/habitat-sh/habitat/blob/master/components/pkg-dockerize/bin/hab-pkg-dockerize.sh


Hello -

These docs [0] show how to run in any environment.

Cheers -

[0] https://www.habitat.sh/docs/run-packages-overview/


The “hab pkg export mesos” is close to what you’ll probably need. It provides a tarball with the application and supervisor included. Because it’s for a mesos container, it has a bit of OS scaffolding included but you could refine it further. Take a look at


Also, this is a for sure, slam dunk feature request. If you want to take a crack at hacking a format exporter together, we’ll be happy to help in the slack channel.


Ok thanks both. I will look at these.