osbuilder: Re-enable building the agent in Docker

or Podman. This is a partial revert of
76c18aa345. The rationale behind that
commit was the fact that the agent could not be built on Alpine, and
then this capability was removed altogether. The issue in Alpine has
since been resolved (see
https://github.com/kata-containers/osbuilder/issues/386). At the same
time, this ensures being able to run a glibc agent on hosts with distros
more recent than the osbuilder distro used (i.e. as of now, when you
build the agent on the host, and its glibc is newer than the one used in
the guest, the agent may encounter unresolved symbols).

Fixes #2398
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke 2021-10-15 16:13:44 +02:00
parent baf4784a29
commit eb5dd76e9d
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE
2 changed files with 24 additions and 9 deletions

View File

@ -7,7 +7,23 @@ ARG IMAGE_REGISTRY=docker.io
FROM ${IMAGE_REGISTRY}/alpine:3.13.5 FROM ${IMAGE_REGISTRY}/alpine:3.13.5
RUN apk update && apk add \ RUN apk update && apk add \
apk-tools-static \
autoconf \
automake \
bash \ bash \
curl \ binutils \
cmake \
coreutils \ coreutils \
binutils curl \
g++ \
gcc \
git \
libc-dev \
libseccomp \
libseccomp-dev \
linux-headers \
m4 \
make \
musl \
musl-dev \
tar

View File

@ -420,7 +420,6 @@ build_rootfs_distro()
--env INSIDE_CONTAINER=1 \ --env INSIDE_CONTAINER=1 \
--env SECCOMP="${SECCOMP}" \ --env SECCOMP="${SECCOMP}" \
--env DEBUG="${DEBUG}" \ --env DEBUG="${DEBUG}" \
--env STAGE_PREPARE_ROOTFS=1 \
--env HOME="/root" \ --env HOME="/root" \
-v "${repo_dir}":"/kata-containers" \ -v "${repo_dir}":"/kata-containers" \
-v "${ROOTFS_DIR}":"/rootfs" \ -v "${ROOTFS_DIR}":"/rootfs" \
@ -429,6 +428,8 @@ build_rootfs_distro()
$docker_run_args \ $docker_run_args \
${image_name} \ ${image_name} \
bash /kata-containers/tools/osbuilder/rootfs-builder/rootfs.sh "${distro}" bash /kata-containers/tools/osbuilder/rootfs-builder/rootfs.sh "${distro}"
exit $?
fi fi
} }
@ -649,10 +650,8 @@ main()
prepare_overlay prepare_overlay
fi fi
if [ "$STAGE_PREPARE_ROOTFS" == "" ]; then
init="${ROOTFS_DIR}/sbin/init" init="${ROOTFS_DIR}/sbin/init"
setup_rootfs setup_rootfs
fi
} }
main $* main $*