mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
Merge pull request #3375 from zhaojizhuang/debianrootfs
osbuilder: Restore Debian as a rootfs
This commit is contained in:
commit
b2166560fa
@ -42,6 +42,7 @@ type testDataDistro struct {
|
|||||||
var distros = []string{
|
var distros = []string{
|
||||||
"centos",
|
"centos",
|
||||||
"clear-linux-os",
|
"clear-linux-os",
|
||||||
|
"debian",
|
||||||
"fedora",
|
"fedora",
|
||||||
"opensuse",
|
"opensuse",
|
||||||
"rhel",
|
"rhel",
|
||||||
|
34
tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in
Normal file
34
tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2020 ARM Limited
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
ARG IMAGE_REGISTRY=docker.io
|
||||||
|
# NOTE: OS_VERSION is set according to config.sh
|
||||||
|
FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@
|
||||||
|
|
||||||
|
# RUN commands
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
binutils \
|
||||||
|
build-essential \
|
||||||
|
chrony \
|
||||||
|
coreutils \
|
||||||
|
curl \
|
||||||
|
debianutils \
|
||||||
|
debootstrap \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
git \
|
||||||
|
libc-dev \
|
||||||
|
libstdc++-8-dev \
|
||||||
|
m4 \
|
||||||
|
make \
|
||||||
|
sed \
|
||||||
|
systemd \
|
||||||
|
tar \
|
||||||
|
vim
|
||||||
|
# This will install the proper packages to build Kata components
|
||||||
|
@INSTALL_MUSL@
|
||||||
|
@INSTALL_RUST@
|
40
tools/osbuilder/rootfs-builder/debian/Dockerfile.in
Normal file
40
tools/osbuilder/rootfs-builder/debian/Dockerfile.in
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2018 SUSE
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
ARG IMAGE_REGISTRY=docker.io
|
||||||
|
# NOTE: OS_VERSION is set according to config.sh
|
||||||
|
FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@
|
||||||
|
|
||||||
|
# RUN commands
|
||||||
|
RUN apt-get update && apt-get --no-install-recommends install -y \
|
||||||
|
apt-utils \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
binutils \
|
||||||
|
build-essential \
|
||||||
|
ca-certificates \
|
||||||
|
chrony \
|
||||||
|
coreutils \
|
||||||
|
curl \
|
||||||
|
debianutils \
|
||||||
|
debootstrap \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
git \
|
||||||
|
libc-dev \
|
||||||
|
libstdc++-8-dev \
|
||||||
|
m4 \
|
||||||
|
make \
|
||||||
|
musl \
|
||||||
|
musl-dev \
|
||||||
|
musl-tools \
|
||||||
|
sed \
|
||||||
|
systemd \
|
||||||
|
tar \
|
||||||
|
vim \
|
||||||
|
wget
|
||||||
|
|
||||||
|
# This will install the proper packages to build Kata components
|
||||||
|
@INSTALL_RUST@
|
20
tools/osbuilder/rootfs-builder/debian/config.sh
Normal file
20
tools/osbuilder/rootfs-builder/debian/config.sh
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2018 SUSE
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
OS_VERSION=${OS_VERSION:-10.11}
|
||||||
|
|
||||||
|
# Set OS_NAME to the desired debian "codename"
|
||||||
|
OS_NAME=${OS_NAME:-"stretch"}
|
||||||
|
|
||||||
|
PACKAGES="systemd coreutils init chrony kmod"
|
||||||
|
|
||||||
|
# NOTE: Re-using ubuntu rootfs configuration, see 'ubuntu' folder for full content.
|
||||||
|
source $script_dir/ubuntu/$CONFIG_SH
|
||||||
|
|
||||||
|
# Init process must be one of {systemd,kata-agent}
|
||||||
|
INIT_PROCESS=systemd
|
||||||
|
# List of zero or more architectures to exclude from build,
|
||||||
|
# as reported by `uname -m`
|
||||||
|
ARCH_EXCLUDE_LIST=()
|
7
tools/osbuilder/rootfs-builder/debian/rootfs_lib.sh
Normal file
7
tools/osbuilder/rootfs-builder/debian/rootfs_lib.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2018 SUSE
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
# NOTE: Re-using ubuntu rootfs lib, see 'ubuntu' folder for details.
|
||||||
|
source ${script_dir}/ubuntu/$LIB_SH
|
@ -193,7 +193,7 @@ docker_extra_args()
|
|||||||
args+=" -v ${gentoo_local_portage_dir}:/usr/portage/packages"
|
args+=" -v ${gentoo_local_portage_dir}:/usr/portage/packages"
|
||||||
args+=" --volumes-from ${gentoo_portage_container}"
|
args+=" --volumes-from ${gentoo_portage_container}"
|
||||||
;;
|
;;
|
||||||
ubuntu | suse)
|
debian | ubuntu | suse)
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
case "$ID" in
|
case "$ID" in
|
||||||
@ -520,8 +520,8 @@ EOT
|
|||||||
chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf"
|
chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf"
|
||||||
chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chronyd.service"
|
chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chronyd.service"
|
||||||
;;
|
;;
|
||||||
"ubuntu")
|
"ubuntu" | "debian")
|
||||||
echo "I am ubuntu"
|
echo "I am ubuntu or debian"
|
||||||
chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf"
|
chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf"
|
||||||
chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chrony.service"
|
chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chrony.service"
|
||||||
;;
|
;;
|
||||||
|
@ -122,7 +122,7 @@ setup()
|
|||||||
|
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
centos|rhel) $chronic sudo -E yum -y install "$pkg" ;;
|
centos|rhel) $chronic sudo -E yum -y install "$pkg" ;;
|
||||||
ubuntu) $chronic sudo -E apt-get --no-install-recommends install -y "$pkg" ;;
|
debian|ubuntu) $chronic sudo -E apt-get --no-install-recommends install -y "$pkg" ;;
|
||||||
fedora) $chronic sudo -E dnf -y install "$pkg" ;;
|
fedora) $chronic sudo -E dnf -y install "$pkg" ;;
|
||||||
opensuse|sles) $chronic sudo -E zypper -y install "$pkg" ;;
|
opensuse|sles) $chronic sudo -E zypper -y install "$pkg" ;;
|
||||||
*) die "do not know how to install command $pkg' for distro '$distro'" ;;
|
*) die "do not know how to install command $pkg' for distro '$distro'" ;;
|
||||||
|
@ -289,7 +289,7 @@ check_deps()
|
|||||||
|
|
||||||
case "$ID" in
|
case "$ID" in
|
||||||
centos|rhel) sudo yum -y install $packages ;;
|
centos|rhel) sudo yum -y install $packages ;;
|
||||||
ubuntu) sudo apt-get -y install $packages ;;
|
debian|ubuntu) sudo apt-get -y install $packages ;;
|
||||||
fedora) sudo dnf -y install $packages ;;
|
fedora) sudo dnf -y install $packages ;;
|
||||||
opensuse*|sles) sudo zypper install -y $packages ;;
|
opensuse*|sles) sudo zypper install -y $packages ;;
|
||||||
*) die "Unsupported distro: $ID"
|
*) die "Unsupported distro: $ID"
|
||||||
|
Loading…
Reference in New Issue
Block a user