Skip to content

Commit fd33dfd

Browse files
authored
Merge pull request #1305 from flatcar/t-lo/gentoo-upstream-containerd-docker
app-containers: switch to upstream docker, containerd, runc, bump docker to v24
2 parents 8a1aa6a + ce88737 commit fd33dfd

File tree

82 files changed

+1742
-1731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1742
-1731
lines changed

.github/workflows/docker-apply-patch.sh

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/docker-release-main.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/portage-stable-packages-list

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ app-arch/zstd
8787

8888
app-cdr/cdrtools
8989

90+
app-containers/cri-tools
91+
app-containers/docker
92+
app-containers/docker-cli
93+
app-containers/docker-proxy
94+
app-containers/runc
95+
9096
app-crypt/adcli
9197
app-crypt/libb2
9298
app-crypt/libmd

.github/workflows/runc-apply-patch.sh

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/runc-release-main.yaml

Lines changed: 0 additions & 65 deletions
This file was deleted.

build_image

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ DEFINE_string base_pkg "coreos-base/coreos" \
3333
"The base portage package to base the build off of (only applies to prod images)"
3434
DEFINE_string base_dev_pkg "coreos-base/coreos-dev" \
3535
"The base portage package to base the build off of (only applies to dev containers)"
36-
DEFINE_string base_sysexts "containerd-flatcar:app-containers/containerd,docker-flatcar:app-containers/docker" \
37-
"Comma-separated list of name:package - build 'package' into sysext 'name', and include with OS image and update payload. Must be in order of dependencies, base sysexts come first."
36+
DEFINE_string base_sysexts "containerd-flatcar:app-containers/containerd,docker-flatcar:app-containers/docker&app-containers/docker-cli" \
37+
"Comma-separated list of name:package[&package[&package]] - build 'package' (a single package or a list of packages separated by '&') into sysext 'name', and include with OS image and update payload. Must be in order of dependencies, base sysexts come first."
3838
DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
3939
"Directory in which to place image result directories (named by version)"
4040
DEFINE_string disk_layout "" \

build_library/sysext_mangle_containerd-flatcar

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
set -euo pipefail
44
rootfs="${1}"
55

6+
7+
# No manpages on Flatcar, no need to ship "stress" tool
8+
echo ">>> NOTICE: $0: removing 'gen-manpages', 'containerd-stress' from sysext"
9+
rm -f "${rootfs}/usr/bin/gen-manpages" "${rootfs}/usr/bin/containerd-stress"
10+
11+
script_root="$(cd "$(dirname "$0")/../"; pwd)"
12+
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/containerd"
13+
14+
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
15+
cp -va "${files_dir}/"* "${rootfs}"
16+
617
mkdir -p "${rootfs}/usr/lib/systemd/system/multi-user.target.d"
718
{ echo "[Unit]"; echo "Upholds=containerd.service"; } > "${rootfs}/usr/lib/systemd/system/multi-user.target.d/10-containerd-service.conf"

build_library/sysext_mangle_docker-flatcar

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,15 @@
33
set -euo pipefail
44
rootfs="${1}"
55

6+
# Remove debug and contrib
7+
echo ">>> NOTICE: $0: removing '/usr/lib/debug/', '/usr/share/docker/contrib' from sysext"
8+
rm -rf "${rootfs}/usr/lib/debug/" "${rootfs}/usr/share/docker/contrib/"
9+
10+
script_root="$(cd "$(dirname "$0")/../"; pwd)"
11+
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/docker"
12+
13+
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
14+
cp -va "${files_dir}/"* "${rootfs}"
15+
616
mkdir -p "${rootfs}/usr/lib/systemd/system/sockets.target.d"
717
{ echo "[Unit]"; echo "Upholds=docker.socket"; } > "${rootfs}/usr/lib/systemd/system/sockets.target.d/10-docker-socket.conf"

build_library/sysext_prod_builder

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ create_prod_sysext() {
3030
local base_sysext="$4"
3131
local install_root="$5"
3232
local name="$6"
33-
local grp_pkg="$7"
33+
local grp_pkgs="$7"
3434
local pkginfo="${8:-}"
3535

3636
local -a build_sysext_opts=()
3737

38-
local msg="Installing ${grp_pkg}' in sysext ${name}.raw"
38+
local -a grp_pkg
39+
mapfile -t grp_pkg <<<"${grp_pkgs//&/$'\n'}"
40+
local msg="Installing ${grp_pkg[*]} in sysext ${name}.raw"
3941

4042
# Include previous sysexts' pkginfo if supplied
4143
if [[ -n "${pkginfo}" ]] ; then
4244
if [[ ! -f "${output_dir}/${pkginfo}" ]] ; then
43-
die "Sysext build '${grp_pkg}': unable to find package info at '${output_dir}/${pkginfo}'."
45+
die "Sysext build '${name}': unable to find package info at '${output_dir}/${pkginfo}'."
4446
fi
4547
msg="${msg} w/ package info '${pkginfo}'"
4648
build_sysext_opts+=( "--base_pkginfo=${output_dir}/${pkginfo}" )
@@ -60,7 +62,7 @@ create_prod_sysext() {
6062
--squashfs_base="${base_sysext}" \
6163
--generate_pkginfo \
6264
"${build_sysext_opts[@]}" \
63-
"${name}" "${grp_pkg}"
65+
"${name}" "${grp_pkg[@]}"
6466

6567
sudo mv "${workdir}/sysext-build/${name}.raw" "${workdir}/sysext-build/${name}_pkginfo.raw" \
6668
"${workdir}/sysext-build/${name}"_*.txt "${output_dir}"

build_sysext

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ DEFINE_string squashfs_base '' \
2525
"The path to the squashfs base image. Defaults to the most current image built in '${default_imagedir}/${FLATCAR_PRODUCTION_IMAGE_SYSEXT_BASE}'."
2626
DEFINE_string image_builddir '' \
2727
"Custom directory to build the sysext in. Defaults to a 'sysext' sub-directory of the directory the squashfs base image resides in; '${default_imagedir}/sysext' by default."
28+
DEFINE_boolean strip_binaries "${FLAGS_FALSE}" \
29+
"After installation, scan sysext root for unstripped binaries and strip these. WARNING - this can subtly break some packages, e.g. Docker (see https://github.com/moby/moby/blob/master/project/PACKAGERS.md#stripping-binaries)."
2830
DEFINE_string manglefs_script '' \
2931
"A path to executable that will customize the rootfs of the sysext image."
3032
DEFINE_boolean generate_pkginfo "${FLAGS_FALSE}" \
@@ -231,6 +233,22 @@ info "Writing ${SYSEXTNAME}_packages.txt"
231233
ROOT="${BUILD_DIR}/install-root" PORTAGE_CONFIGROOT="${BUILD_DIR}/install-root" \
232234
equery --no-color list --format '$cpv::$repo' '*' > "${BUILD_DIR}/${SYSEXTNAME}_packages.txt"
233235

236+
237+
if [[ "${FLAGS_strip_binaries}" = "${FLAGS_TRUE}" ]]; then
238+
chost="$("portageq-${BOARD}" envvar CHOST)"
239+
strip="${chost}-strip"
240+
241+
info "Stripping all non-stripped binaries in sysext using '${strip}'"
242+
243+
# Find all non-stripped binaries, remove ':' from filepath, and strip 'em
244+
find "${BUILD_DIR}/install-root" -exec file \{\} \; \
245+
| awk '/not stripped/ {print substr($1, 1, length($1)-1)}' \
246+
| while read bin; do
247+
info " ${strip} ${bin}"
248+
"${strip}" "${bin}"
249+
done
250+
fi
251+
234252
if [[ -n "${FLAGS_manglefs_script}" ]]; then
235253
if [[ ! -x "${FLAGS_manglefs_script}" ]]; then
236254
die "${FLAGS_manglefs_script} is not executable"

0 commit comments

Comments
 (0)