mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 14:58:16 +00:00
Merge pull request #3222 from Jakob-Naucke/apk-static
osbuilder: Revert to using apk.static for Alpine
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
ARG IMAGE_REGISTRY=docker.io
|
ARG IMAGE_REGISTRY=docker.io
|
||||||
FROM ${IMAGE_REGISTRY}/alpine:3.13.5
|
FROM ${IMAGE_REGISTRY}/alpine:3.15
|
||||||
|
|
||||||
RUN apk update && apk add \
|
RUN apk update && apk add \
|
||||||
apk-tools-static \
|
apk-tools-static \
|
||||||
|
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
OS_NAME="Alpine"
|
OS_NAME="Alpine"
|
||||||
|
|
||||||
OS_VERSION=${OS_VERSION:-latest-stable}
|
OS_VERSION=${OS_VERSION:-3.15}
|
||||||
|
|
||||||
BASE_PACKAGES="alpine-base"
|
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
|
||||||
}
|
}
|
||||||
|
@@ -139,7 +139,7 @@ assets:
|
|||||||
architecture:
|
architecture:
|
||||||
aarch64:
|
aarch64:
|
||||||
name: &default-initrd-name "alpine"
|
name: &default-initrd-name "alpine"
|
||||||
version: &default-initrd-version "3.13.5"
|
version: &default-initrd-version "3.15"
|
||||||
# Do not use Alpine on ppc64le & s390x, the agent cannot use musl because
|
# Do not use Alpine on ppc64le & s390x, the agent cannot use musl because
|
||||||
# there is no such Rust target
|
# there is no such Rust target
|
||||||
ppc64le:
|
ppc64le:
|
||||||
|
Reference in New Issue
Block a user