Skip to content

Commit 5dbb6d1

Browse files
committed
optimization debian package manager tweaks
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) . Signed-off-by: Pratik Raj <[email protected]>
1 parent bcaa665 commit 5dbb6d1

File tree

21 files changed

+37
-37
lines changed

21 files changed

+37
-37
lines changed

3.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL Description="Docker Container for the Apple's Swift programming language"
44

55
# Install related packages and set LLVM 3.8 as the compiler
66
RUN apt-get -q update && \
7-
apt-get -q install -y \
7+
apt-get --no-install-recommends -q install -y \
88
make \
99
libc6-dev \
1010
clang-3.8 \

4.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL Description="Docker Container for the Apple's Swift programming language"
44

55
# Install related packages and set LLVM 3.8 as the compiler
66
RUN apt-get -q update && \
7-
apt-get -q install -y \
7+
apt-get --no-install-recommends -q install -y \
88
make \
99
libc6-dev \
1010
clang-3.8 \

4.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL Description="Docker Container for the Apple's Swift programming language"
44

55
# Install related packages and set LLVM 3.8 as the compiler
66
RUN apt-get -q update && \
7-
apt-get -q install -y \
7+
apt-get --no-install-recommends -q install -y \
88
make \
99
libc6-dev \
1010
clang-3.8 \

4.2/ubuntu/16.04/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL Description="Docker Container for the Swift programming language"
44

55
# Install related packages and set LLVM 3.8 as the compiler
66
RUN apt-get -q update && \
7-
apt-get -q install -y \
7+
apt-get --no-install-recommends -q install -y \
88
make \
99
libc6-dev \
1010
clang-3.8 \

4.2/ubuntu/18.04/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL Description="Docker Container for the Swift programming language"
44

55
# Install related packages and set LLVM 3.9 as the compiler
66
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
7-
apt-get -q install -y \
7+
apt-get --no-install-recommends -q install -y \
88
make \
99
libc6-dev \
1010
clang-3.9 \

5.0/ubuntu/16.04/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL Description="Docker Container for the Swift programming language"
44

55
RUN apt-get -q update && \
6-
apt-get -q install -y \
6+
apt-get --no-install-recommends -q install -y \
77
libatomic1 \
88
libbsd0 \
99
libcurl3 \
@@ -33,7 +33,7 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
3333
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
3434
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
3535
&& apt-get -q update \
36-
&& apt-get -q install -y curl \
36+
&& apt-get --no-install-recommends -q install -y curl \
3737
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
3838
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
3939
&& apt-get purge -y curl \

5.0/ubuntu/16.04/slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL Description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6-
apt-get -q install -y \
6+
apt-get --no-install-recommends -q install -y \
77
libatomic1 \
88
libbsd0 \
99
libcurl3 \
@@ -23,7 +23,7 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
2323
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
2424
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
2525
&& apt-get update \
26-
&& apt-get install -y curl \
26+
&& apt-get --no-install-recommends install -y curl \
2727
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
2828
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
2929
&& export GNUPGHOME="$(mktemp -d)" \

5.0/ubuntu/18.04/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL Description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6-
apt-get -q install -y \
6+
apt-get --no-install-recommends -q install -y \
77
libatomic1 \
88
libbsd0 \
99
libcurl4 \
@@ -33,7 +33,7 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
3333
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
3434
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
3535
&& apt-get update \
36-
&& apt-get install -y curl \
36+
&& apt-get --no-install-recommends install -y curl \
3737
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
3838
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
3939
&& apt-get purge -y curl \

5.0/ubuntu/18.04/slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL Description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6-
apt-get -q install -y \
6+
apt-get --no-install-recommends -q install -y \
77
libatomic1 \
88
libbsd0 \
99
libcurl4 \
@@ -23,7 +23,7 @@ ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
2323
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
2424
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
2525
&& apt-get update \
26-
&& apt-get install -y curl gpg \
26+
&& apt-get --no-install-recommends install -y curl gpg \
2727
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
2828
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
2929
&& export GNUPGHOME="$(mktemp -d)" \

5.1/ubuntu/16.04/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL Description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6-
apt-get -q install -y \
6+
apt-get --no-install-recommends -q install -y \
77
libatomic1 \
88
libcurl3 \
99
libxml2 \
@@ -43,7 +43,7 @@ RUN set -e; \
4343
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
4444
# - Grab curl here so we cache better up above
4545
&& export DEBIAN_FRONTEND=noninteractive \
46-
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
46+
&& apt-get -q update && apt-get --no-install-recommends -q install -y curl && rm -rf /var/lib/apt/lists/* \
4747
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
4848
&& export GNUPGHOME="$(mktemp -d)" \
4949
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \

0 commit comments

Comments
 (0)