-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kornilios Kourtis <[email protected]>
- Loading branch information
0 parents
commit 4109eb1
Showing
7 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
OCIORG ?= quay.io/lvh-images | ||
LVH ?= $(OCIORG)/lvh | ||
ROOT_BUILDER ?= $(OCIORG)/root-builder | ||
ROOT_IMAGES ?= $(OCIORG)/root-images | ||
DOCKER ?= docker | ||
|
||
.PHONY: images | ||
images: | ||
$(DOCKER) build -f dockerfiles/root-builder -t $(ROOT_BUILDER) . | ||
$(DOCKER) build -f dockerfiles/root-images -t $(ROOT_IMAGES) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This repository contains (little-vm-helper)[https://github.com/cilium/little-vm-helper] | ||
configuration files and dockerfiles for building kernel and rootfs images. | ||
|
||
- [configuration](_data/images.json) for building root images (single image for now) | ||
- [dockerfile](./dockerfiles/root-builder) for a container that can be used to build root images | ||
- [dockerfile](./dockerfiles/root-images) for a container with the root images | ||
|
||
### Issues | ||
- Using docker build means that there will be no /dev/kvm device in the builder which will | ||
unfortunately result in slower builds than what you would get otherwise. There are some hints | ||
in https://github.com/moby/moby/issues/1916 that this might be solved using buildx, but I'm not | ||
sure how. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
images | ||
kernels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/images | ||
/kernels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"name": "base.qcow2", | ||
"packages": [ | ||
"less", | ||
"vim", | ||
"sudo", | ||
"openssh-server", | ||
"curl", | ||
"bpftool", | ||
"iproute2", | ||
"util-linux" | ||
], | ||
"actions": [ | ||
{ | ||
"comment": "disable password for root", | ||
"op": { | ||
"Cmd": "passwd -d root" | ||
}, | ||
"type": "run-command" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# vim: set ft=dockerfile: | ||
FROM quay.io/lvh-images/lvh AS lvh | ||
|
||
FROM debian:sid | ||
WORKDIR / | ||
RUN apt-get update -yq && \ | ||
apt-get upgrade -yq && \ | ||
apt-get install -yq mmdebstrap libguestfs-tools qemu-utils extlinux | ||
COPY --from=lvh /usr/bin/lvh /usr/bin/lvh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# vim: set ft=dockerfile: | ||
FROM quay.io/lvh-images/root-builder AS builder | ||
COPY _data /data | ||
WORKDIR /data | ||
# mmdebstrap outputs messages in stderr, so we redirect stderr | ||
RUN lvh images build --dir . 2>&1 | ||
|
||
FROM busybox | ||
COPY --from=builder /data/images/base.qcow2 /images/base.qcow2 | ||
RUN gzip /images/base.qcow2 |