Skip to content

Commit

Permalink
Merge pull request #1 from cilium/markpash/optimizations
Browse files Browse the repository at this point in the history
root-*: install fewer packages and use zstd for compression
  • Loading branch information
kkourt authored Aug 4, 2022
2 parents 4d2f59f + e40fc70 commit b7e2482
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 10 additions & 4 deletions dockerfiles/root-builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
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
RUN apt-get update --quiet && \
apt-get upgrade --quiet --yes && \
apt-get install --quiet --yes --no-install-recommends \
mmdebstrap \
libguestfs-tools \
qemu-utils \
extlinux \
linux-image-amd64 \
zstd
10 changes: 6 additions & 4 deletions dockerfiles/root-images
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# 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
RUN lvh images build --dir /data 2>&1
RUN zstd --compress --rm --threads=0 /data/images/*.qcow2

# Can't use scratch here because we use `docker create` elsewhere, and
# that doesn't work without an explicit command. Satisfy this with
# busybox.
FROM busybox
COPY --from=builder /data/images/base.qcow2 /data/images/base.qcow2
RUN gzip /data/images/base.qcow2
COPY --from=builder /data/images /data/images

0 comments on commit b7e2482

Please sign in to comment.