flatcar-scripts/build_library/sysext_mangle_docker-flatcar
Thilo Fromm 9f45ea05e9 app-containers: use upstream docker, containerd, runc
This change removes Flatcar specific builds of docker[-cli], containerd,
runc, and cri-tools and instead switches to upstream Gentoo ebuilds
added to portage-stable.

The change updates docker to 24.0.6.

NOTE that there currently is no upstream ebuild for containerd-1.7.7, so
this change adds that ebuild based on the upstream containerd-1.7.6
ebuild.

Flatcar customisations like systemd units etc. are now applied in the
manglefs script of the respective sysexts, based on file system trees in
coreos-overlay/coreos/sysext/(containerd|docker).

The build_sysext script has been extended by an option to strip all
binaries in a sysext; the option is active by default. This takes care
of removing debug symbols from docker and containerd - which are not
removed by the default Gentoo build. The overall size of both containerd
and docker sysext is reduced by ~50%.

Lastly, the sysext command line syntax of build_image has been extended
to allow specifying multiple packages for a sysext. This was necessary
because docker-cli and docker do not have any runtime relationships and
therefore must both be specified for installation to correctly mirror
Flatcar's own docker packaging.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-30 17:21:26 +01:00

18 lines
666 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
rootfs="${1}"
# Remove debug and contrib
echo ">>> NOTICE: $0: removing '/usr/lib/debug/', '/usr/share/docker/contrib' from sysext"
rm -rf "${rootfs}/usr/lib/debug/" "${rootfs}/usr/share/docker/contrib/"
script_root="$(cd "$(dirname "$0")/../"; pwd)"
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/docker"
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
cp -va "${files_dir}/"* "${rootfs}"
mkdir -p "${rootfs}/usr/lib/systemd/system/sockets.target.d"
{ echo "[Unit]"; echo "Upholds=docker.socket"; } > "${rootfs}/usr/lib/systemd/system/sockets.target.d/10-docker-socket.conf"