mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 13:08:00 +00:00
debian: Don't install recommended software
By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . Fixes: #970 Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
This commit is contained in:
parent
844f21ce5a
commit
d527c4ff64
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
sudo apt-get update -y -qq
|
sudo apt-get update -y -qq
|
||||||
sudo apt-get install -y git
|
sudo apt-get --no-install-recommends install -y git
|
||||||
git config --global user.email "azure-pipeline@kata.io"
|
git config --global user.email "azure-pipeline@kata.io"
|
||||||
git config --global user.name "azure-pipeline"
|
git config --global user.name "azure-pipeline"
|
||||||
.ci/packaging/setup.sh
|
.ci/packaging/setup.sh
|
||||||
|
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
sudo apt-get update -y -qq
|
sudo apt-get update -y -qq
|
||||||
sudo apt-get install -y git
|
sudo apt-get --no-install-recommends install -y git
|
||||||
git config --global user.email "azure-pipeline@kata.io"
|
git config --global user.email "azure-pipeline@kata.io"
|
||||||
git config --global user.name "azure-pipeline"
|
git config --global user.name "azure-pipeline"
|
||||||
displayName: 'Setup'
|
displayName: 'Setup'
|
||||||
|
@ -37,7 +37,7 @@ if [ "$SNAP_CI" == "true" ] && [ "$ID" == "ubuntu" ]; then
|
|||||||
export INSTALL_KATA="no"
|
export INSTALL_KATA="no"
|
||||||
|
|
||||||
echo "Install snap dependencies"
|
echo "Install snap dependencies"
|
||||||
sudo apt-get install -y snapd snapcraft make
|
sudo apt-get --no-install-recommends install -y snapd snapcraft make
|
||||||
|
|
||||||
echo "Building snap image"
|
echo "Building snap image"
|
||||||
make snap
|
make snap
|
||||||
|
@ -47,12 +47,12 @@ install_go() {
|
|||||||
|
|
||||||
install_docker() {
|
install_docker() {
|
||||||
echo "Installing docker"
|
echo "Installing docker"
|
||||||
sudo -E apt-get -y install apt-transport-https ca-certificates software-properties-common
|
sudo -E apt-get --no-install-recommends install -y apt-transport-https ca-certificates software-properties-common
|
||||||
curl -sL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
curl -sL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||||
arch=$(dpkg --print-architecture)
|
arch=$(dpkg --print-architecture)
|
||||||
sudo -E add-apt-repository "deb [arch=${arch}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
sudo -E add-apt-repository "deb [arch=${arch}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
sudo -E apt-get update
|
sudo -E apt-get update
|
||||||
sudo -E apt-get -y install docker-ce
|
sudo -E apt-get --no-install-recommends install -y docker-ce
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_git() {
|
setup_git() {
|
||||||
|
@ -34,7 +34,7 @@ runcmd:
|
|||||||
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list"
|
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list"
|
||||||
- {{proxyVars .}} curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add -
|
- {{proxyVars .}} curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add -
|
||||||
- sudo -E apt-get update
|
- sudo -E apt-get update
|
||||||
- sudo -E apt-get -y install kata-runtime
|
- sudo -E apt-get --no-install-recommends install -y kata-runtime
|
||||||
- {{endTaskCheck .}}
|
- {{endTaskCheck .}}
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -17,7 +17,7 @@ Kata Containers can be installed in any Linux distribution that supports
|
|||||||
[snapd](https://docs.snapcraft.io/installing-snapd). For this example, we
|
[snapd](https://docs.snapcraft.io/installing-snapd). For this example, we
|
||||||
assume Ubuntu as your base distro.
|
assume Ubuntu as your base distro.
|
||||||
```sh
|
```sh
|
||||||
$ sudo apt-get install -y snapd snapcraft
|
$ sudo apt-get --no-install-recommends install -y snapd snapcraft
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install snap
|
## Install snap
|
||||||
|
@ -196,7 +196,7 @@ parts:
|
|||||||
# install podman
|
# install podman
|
||||||
sudo add-apt-repository -y ppa:projectatomic/ppa
|
sudo add-apt-repository -y ppa:projectatomic/ppa
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install podman
|
sudo apt-get --no-install-recommends install -y podman
|
||||||
|
|
||||||
# Build and install cni plugings
|
# Build and install cni plugings
|
||||||
echo "Retrieve CNI plugins repository"
|
echo "Retrieve CNI plugins repository"
|
||||||
@ -382,7 +382,7 @@ parts:
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Only x86_64 supports libpmem
|
# Only x86_64 supports libpmem
|
||||||
[ "$(uname -m)" = "x86_64" ] && sudo apt-get install -y libpmem-dev
|
[ "$(uname -m)" = "x86_64" ] && sudo apt-get --no-install-recommends install -y libpmem-dev
|
||||||
|
|
||||||
chmod +x ${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh
|
chmod +x ${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh
|
||||||
# static build
|
# static build
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yq build-essential mtools libssl-dev pkg-config curl git
|
RUN apt-get --no-install-recommends install -yq build-essential mtools libssl-dev pkg-config curl git
|
||||||
RUN nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
RUN nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
|
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
@ -8,7 +8,7 @@ ARG PREFIX
|
|||||||
|
|
||||||
WORKDIR /root/qemu-virtiofs
|
WORKDIR /root/qemu-virtiofs
|
||||||
RUN apt-get update && apt-get upgrade -y
|
RUN apt-get update && apt-get upgrade -y
|
||||||
RUN apt-get install -y \
|
RUN apt-get --no-install-recommends install -y \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bc \
|
bc \
|
||||||
|
@ -8,7 +8,7 @@ ARG PREFIX
|
|||||||
|
|
||||||
WORKDIR /root/qemu
|
WORKDIR /root/qemu
|
||||||
RUN apt-get update && apt-get upgrade -y
|
RUN apt-get update && apt-get upgrade -y
|
||||||
RUN apt-get install -y \
|
RUN apt-get --no-install-recommends install -y \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bc \
|
bc \
|
||||||
|
@ -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" ;;
|
||||||
debian|ubuntu) $chronic sudo -E apt -y install "$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'" ;;
|
||||||
|
@ -50,7 +50,7 @@ generate_dockerfile() {
|
|||||||
;;
|
;;
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
UPDATE="apt-get -y update"
|
UPDATE="apt-get -y update"
|
||||||
DEPENDENCIES="apt-get install -y curl git gnupg2 lsb-release sudo"
|
DEPENDENCIES="apt-get --no-install-recommends install -y curl git gnupg2 lsb-release sudo"
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora)
|
||||||
UPDATE="dnf -y update"
|
UPDATE="dnf -y update"
|
||||||
|
Loading…
Reference in New Issue
Block a user