Skip to content

Commit

Permalink
Some debian package manager tweaks
Browse files Browse the repository at this point in the history
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) .
  • Loading branch information
Rajpratik71 committed Mar 8, 2020
1 parent 36e5656 commit 9d1dce5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hooks/nvidia-bootstrap/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM debian:jessie
# ^ Cannot be Alpine since it does not support systemctl
# ^ Systemctl is used to restart kubelet upon successful run of run.sh

RUN apt-get update && apt-get -yq install curl jq
RUN apt-get update && apt-get --no-install-recommends -yq install curl jq

ADD run.sh /run.sh

Expand Down
4 changes: 2 additions & 2 deletions images/dns-controller-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ FROM k8s.gcr.io/debian-base-amd64:0.3
# curl (to download golang)
# git (for getting the current head)
# gcc make (for compilation)
RUN apt-get update && apt-get install --yes --reinstall lsb-base \
&& apt-get install --yes curl git gcc make bash \
RUN apt-get update && apt-get --no-install-recommends install --yes --reinstall lsb-base \
&& apt-get --no-install-recommends install --yes curl git gcc make bash \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion images/dns-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FROM k8s.gcr.io/debian-base-amd64:0.3

# ca-certificates: Needed to talk to EC2 API
RUN apt-get update && apt-get install --yes ca-certificates \
RUN apt-get update && apt-get --no-install-recommends install --yes ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
4 changes: 2 additions & 2 deletions images/protokube-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ FROM k8s.gcr.io/debian-base-amd64:0.3
# curl (to download golang)
# git (for getting the current head)
# gcc make (for compilation)
RUN apt-get update && apt-get install --yes --reinstall lsb-base \
&& apt-get install --yes curl git gcc make bash \
RUN apt-get update && apt-get --no-install-recommends install --yes --reinstall lsb-base \
&& apt-get --no-install-recommends install --yes curl git gcc make bash \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion images/protokube/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM k8s.gcr.io/debian-base-amd64:0.3

# ca-certificates: Needed to talk to EC2 API
# e2fsprogs: Needed to mount / format ext4 filesytems
RUN apt-get update && apt-get install --yes \
RUN apt-get update && apt-get --no-install-recommends install --yes \
bash ca-certificates e2fsprogs systemd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion images/utils-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ deb http://security.debian.org jessie/updates main\n \
deb-src http://security.debian.org jessie/updates main\n \
deb-src http://ftp.us.debian.org/debian/ jessie main" > /etc/apt/sources.list

RUN apt-get update && apt-get install --yes dpkg-dev bash \
RUN apt-get update && apt-get --no-install-recommends install --yes dpkg-dev bash \
&& apt-get build-dep --yes socat conntrack \
&& apt-get clean

Expand Down

0 comments on commit 9d1dce5

Please sign in to comment.