From 223bf910dfc3bffd0536a6d321763eb3759e6079 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 8 May 2019 11:03:42 +1200 Subject: [PATCH] Backport two minimizations for the docker images: remove apt lists that are removed downstream anyway, and remove device nodes from the image. (LP: #1828118) --- debian/changelog | 8 ++++++++ live-build/auto/build | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/debian/changelog b/debian/changelog index e141f966..97167622 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.525.23) UNRELEASED; urgency=medium + + * Backport two minimizations for the docker images: remove apt lists that + are removed downstream anyway, and remove device nodes from the image. + (LP: #1828118) + + -- Michael Hudson-Doyle Wed, 08 May 2019 10:48:39 +1200 + livecd-rootfs (2.525.22) bionic; urgency=medium * Subiquity specific changes SRU LP: #1827357 diff --git a/live-build/auto/build b/live-build/auto/build index 19175cd8..a6fc4af1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -436,6 +436,17 @@ EOF # remove crufty files that shouldn't be left in an image rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old Chroot chroot apt clean + # For the docker images we remove even more stuff. + if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then + # Remove apt lists (that are currently removed downstream + # anyway) + rm -rf chroot/var/lib/apt/lists/* + # Having device nodes in the docker image can cause problems + # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) + # so remove them. We only do this for docker out of an + # abundance of caution. + rm -rf chroot/dev/* + fi lb binary "$@" touch binary.success