mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-23 05:58:04 +00:00
osbuilder: Revert to using apk.static for Alpine
#2399 partially reverted #418, missing on returning to bootstrapping a rootfs with `apk.static` instead of copying the entire root, which can result in drastically larger (more than 10x) images. Revert this as well (requires some updates to URL building). Fixes: #3216 Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
parent
7522109abc
commit
dfd0732ff9
@ -11,7 +11,7 @@ BASE_PACKAGES="alpine-base"
|
|||||||
|
|
||||||
# Alpine mirror to use
|
# Alpine mirror to use
|
||||||
# See a list of mirrors at http://nl.alpinelinux.org/alpine/MIRRORS.txt
|
# See a list of mirrors at http://nl.alpinelinux.org/alpine/MIRRORS.txt
|
||||||
MIRROR=http://dl-5.alpinelinux.org/alpine
|
MIRROR=https://dl-5.alpinelinux.org/alpine
|
||||||
|
|
||||||
PACKAGES=""
|
PACKAGES=""
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
#
|
#
|
||||||
# - Optional environment variables
|
# - Optional environment variables
|
||||||
#
|
#
|
||||||
|
# EXTRA_PKGS: Variable to add extra PKGS provided by the user
|
||||||
|
#
|
||||||
# BIN_AGENT: Name of the Kata-Agent binary
|
# BIN_AGENT: Name of the Kata-Agent binary
|
||||||
#
|
#
|
||||||
# Any other configuration variable for a specific distro must be added
|
# Any other configuration variable for a specific distro must be added
|
||||||
@ -22,13 +24,20 @@ build_rootfs() {
|
|||||||
# Mandatory
|
# Mandatory
|
||||||
local ROOTFS_DIR=$1
|
local ROOTFS_DIR=$1
|
||||||
|
|
||||||
|
# Add extra packages to the rootfs when specified
|
||||||
|
local EXTRA_PKGS=${EXTRA_PKGS:-}
|
||||||
|
|
||||||
# Populate ROOTFS_DIR
|
# Populate ROOTFS_DIR
|
||||||
check_root
|
check_root
|
||||||
mkdir -p "${ROOTFS_DIR}"
|
mkdir -p "${ROOTFS_DIR}"
|
||||||
|
|
||||||
rm -rf ${ROOTFS_DIR}/var/tmp
|
/sbin/apk.static \
|
||||||
cp -a -r -f /bin /etc /lib /sbin /usr /var ${ROOTFS_DIR}
|
-X ${MIRROR}/v${OS_VERSION}/main \
|
||||||
mkdir -p ${ROOTFS_DIR}{/root,/proc,/dev,/home,/media,/mnt,/opt,/run,/srv,/sys,/tmp}
|
-U \
|
||||||
|
--allow-untrusted \
|
||||||
|
--root ${ROOTFS_DIR} \
|
||||||
|
--initdb add ${BASE_PACKAGES} ${EXTRA_PKGS} ${PACKAGES}
|
||||||
|
|
||||||
echo "${MIRROR}/${OS_VERSION}/main" > ${ROOTFS_DIR}/etc/apk/repositories
|
mkdir -p ${ROOTFS_DIR}{/root,/etc/apk,/proc}
|
||||||
|
echo "${MIRROR}/v${OS_VERSION}/main" > ${ROOTFS_DIR}/etc/apk/repositories
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user