mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-16 06:18:58 +00:00
osbuilder: fix alpine agent build
Since we always build musl kata-agent, there is no need to build it inside a musl container. We can just build on the host and then copy the binary to the target rootfs. There are still a lot to clean up and it should be made so for ALL target distros instead of just alpine. But this is at least working for alpine first. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
#
|
||||
# - Optional environment variables
|
||||
#
|
||||
# EXTRA_PKGS: Variable to add extra PKGS provided by the user
|
||||
#
|
||||
# BIN_AGENT: Name of the Kata-Agent binary
|
||||
#
|
||||
# Any other configuration variable for a specific distro must be added
|
||||
@@ -24,21 +22,12 @@ build_rootfs() {
|
||||
# Mandatory
|
||||
local ROOTFS_DIR=$1
|
||||
|
||||
# In case of support EXTRA packages, use it to allow
|
||||
# users add more packages to the base rootfs
|
||||
local EXTRA_PKGS=${EXTRA_PKGS:-}
|
||||
|
||||
# Populate ROOTFS_DIR
|
||||
check_root
|
||||
mkdir -p "${ROOTFS_DIR}"
|
||||
|
||||
/sbin/apk.static \
|
||||
-X ${MIRROR}/${OS_VERSION}/main \
|
||||
-U \
|
||||
--allow-untrusted \
|
||||
--root ${ROOTFS_DIR}\
|
||||
--initdb add ${BASE_PACKAGES} ${EXTRA_PKGS} ${PACKAGES}
|
||||
cp -a -r /bin /etc /lib /sbin /usr /var ${ROOTFS_DIR}
|
||||
mkdir -p ${ROOTFS_DIR}{/root,/proc,/dev,/home,/media,/mnt,/opt,/run,/srv,/sys,/tmp}
|
||||
|
||||
mkdir -p ${ROOTFS_DIR}{/root,/etc/apk,/proc}
|
||||
echo "${MIRROR}/${OS_VERSION}/main" > ${ROOTFS_DIR}/etc/apk/repositories
|
||||
}
|
||||
|
Reference in New Issue
Block a user