4 ms·
Show HN: Layerfiles, Dockerfiles that build VMs
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.
- colinchartier 4y agoGitHub: https://github.com/webappio/layerfiles https://github.com/webappio/layerfiles Single binary download (linux x64 only for now): https://github.com/webappio/assets/raw/main/lf https://github.com/webappio/assets/raw/main/lf
- allen20008 4y agoWhat are the main use cases for these? Like local development?
- colinchartier 4y agoWhen I talked to prospective users, the big two that people wanted were: 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
- lucypyli 4y agoHow is this different from Kata containers or the other microvm-based Docker frameworks?
- colinchartier 4y agoIt doesn't use a Dockerfile, Kata is a docker-compatible runtime that gives more isolation, Layerfile isn't compatible which lets you have `RUN BACKGROUND` and other VM-only logic that wouldn't otherwise be possible
- danielmogilny 4y agoInteresting stuff. We used singularity containers at Stratum in the past. What's the similarities/differences and advantages between them?