-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimization debian package manager tweaks #158
Conversation
\cc @shahmishal |
@swift-ci test |
1 similar comment
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle, great idea!
How many unnecessary packages does this remove, and what effect does it have on final image size?
5.0/ubuntu/16.04/slim/Dockerfile
Outdated
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>" | |||
LABEL Description="Docker Container for the Swift programming language" | |||
|
|||
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ | |||
apt-get -q install -y \ | |||
apt-get --no-install-recommends install -y apt-utils ca-certificates \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the apt-utils
and ca-certificates
on their own line, to match the rest of the packages.
hi @Rajpratik71, would you like to work with us to bring this over the finish line? |
9b9dd10
to
8504a69
Compare
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) . Also , added packages apt-utils ca-certificates Because build is 1. Slow because "apt-utils" not installed 2. to avoid build to exits with error without having certificate in wget , curl or even git clone Signed-off-by: Pratik Raj <[email protected]>
8504a69
to
d7371c3
Compare
Hi , rebased to upstream and also done changes as requested by @ianpartridge |
@swift-ci test |
thanks so much @Rajpratik71, can you remind me why we needed to add the additionally, we recently added support for Ubuntu 20.04 (5.2 and nightlies) which I think can use the same optimization? |
added packages apt-utils ca-certificates Because build is
|
hi @Rajpratik71
thanks a ton for your contribution! |
Hi @tomerd , These packages are not there before . e.g If any debian based system doesn't have "apt-utils" installed , then in that case any package installation takes time while configuring and gives suggestion to install "apt-utils" . that is why i put that here . And I put "ca-certificates" to avoid build to exits with error without having certificate in wget , curl or even git clone. And yes , for 20.04 images will do that |
@swift-ci Please test |
The Swift project moved the default branch to More detail about the branch update - https://forums.swift.org/t/updating-branch-names/40412 |
created fresh pull to main @ #203 |
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 .
Signed-off-by: Pratik Raj [email protected]