from Hacker News

Show HN: Layerfiles, Dockerfiles that build VMs

by colinchartier on 10/2/22, 6:01 PM with 6 comments

Hey HN,

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.