-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reduce container image size by +/- 50% (+/- 4MB)
- Loading branch information
1 parent
bc0f352
commit eabe71a
Showing
1 changed file
with
10 additions
and
7 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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
FROM alpine:3.18.0 AS build | ||
RUN mkdir -p /build/etc/apk /build/var/run /empty | ||
RUN mkdir -p /build/etc/apk /build/var/run | ||
RUN cp -r /etc/apk/* /build/etc/apk/ | ||
RUN apk add --no-cache --initdb -p /build qemu-guest-agent musl | ||
|
||
FROM scratch | ||
COPY --from=build /build/bin /bin | ||
COPY --from=build /build/etc /etc | ||
COPY --from=build /build/lib /lib | ||
COPY --from=build /build/sbin /sbin | ||
COPY --from=build /build/usr /usr | ||
COPY --from=build /build/var /var | ||
COPY --from=build /build/usr/bin/qemu-ga /usr/bin/qemu-ga | ||
COPY --from=build /build/lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1 | ||
COPY --from=build /build/usr/lib/libnuma.so.1 /usr/lib/libnuma.so.1 | ||
COPY --from=build /build/usr/lib/liburing.so.2 /usr/lib/liburing.so.2 | ||
COPY --from=build /build/usr/lib/libglib-2.0.so.0 /usr/lib/libglib-2.0.so.0 | ||
COPY --from=build /build/usr/lib/libgmodule-2.0.so.0 /usr/lib/libgmodule-2.0.so.0 | ||
COPY --from=build /build/usr/lib/libintl.so.8 /usr/lib/libintl.so.8 | ||
COPY --from=build /build/usr/lib/libpcre2-8.so.0 /usr/lib/libpcre2-8.so.0 | ||
COPY --from=build /build/var/run /var/run | ||
|
||
CMD ["/usr/bin/qemu-ga", "--method", "virtio-serial", "--path", "/dev/virtio-ports/org.qemu.guest_agent.0"] |