Show HN: Layerfiles, Dockerfiles that build VMs
I’m excited to show you Layerfiles, an OSS project which gives you a single binary to build microvms using a syntax that looks like a Dockerfile.
The project is currently in alpha, but it’s already able to build a VM on Linux hosts.
MicroVMs are like containers, but have several upsides:
- They can run on any OS, so you don’t need to run a wrapper VM like Docker Desktop does.
- They also let you keep processes running during a build (RUN BACKGROUND), so you can run a webserver or build server in the background.
- You can generally run them rootless without any extra configuration.
Here’s an example Layerfile you can try:
FROM vm/ubuntu:22.04
RUN BACKGROUND python3 -m http.server 8000
RUN curl localhost:8000
COPY . .
RUN ls
I'd love any comments or feedback! I’d also appreciate if someone could try building it for Mac or Windows.
6 comments
[ 3.3 ms ] story [ 26.9 ms ] threadSingle binary download (linux x64 only for now): https://github.com/webappio/assets/raw/main/lf
1. Replacement for Vagrant / docker desktop - you'd hibernate your VM, check out someone else's branch, and start a new environment to avoid breaking your own
2. Run acceptance tests in a reproducible way, RUN docker-compose up // RUN ocker-compose run --rm acceptance-tests for example