Skip to content

Commit 552391d

Browse files
committed
Only install curl (and gnupg for the 18.04 slim image) for the last build step. Caching works much better that way.
1 parent d00aab1 commit 552391d

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

5.1/ubuntu/16.04/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
1717
tzdata \
1818
git \
1919
pkg-config \
20-
curl \
2120
&& rm -r /var/lib/apt/lists/*
2221

2322
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -41,6 +40,9 @@ RUN set -e; \
4140
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
4241
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
4342
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
43+
# - Grab curl here so we cache better up above
44+
&& export DEBIAN_FRONTEND=noninteractive \
45+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
4446
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
4547
&& export GNUPGHOME="$(mktemp -d)" \
4648
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \

5.1/ubuntu/16.04/slim/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
88
libcurl3 \
99
libxml2 \
1010
tzdata \
11-
curl \
1211
&& rm -r /var/lib/apt/lists/*
1312

1413
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -32,6 +31,9 @@ RUN set -e; \
3231
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
3332
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
3433
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
34+
# - Grab curl here so we cache better up above
35+
&& export DEBIAN_FRONTEND=noninteractive \
36+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
3537
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
3638
&& export GNUPGHOME="$(mktemp -d)" \
3739
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \

5.1/ubuntu/18.04/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
1717
tzdata \
1818
git \
1919
pkg-config \
20-
curl \
2120
&& rm -r /var/lib/apt/lists/*
2221

2322
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -41,6 +40,9 @@ RUN set -e; \
4140
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
4241
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
4342
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
43+
# - Grab curl here so we cache better up above
44+
&& export DEBIAN_FRONTEND=noninteractive \
45+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
4446
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
4547
&& export GNUPGHOME="$(mktemp -d)" \
4648
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \

5.1/ubuntu/18.04/slim/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
88
libcurl4 \
99
libxml2 \
1010
tzdata \
11-
curl \
12-
gnupg \
1311
&& rm -r /var/lib/apt/lists/*
1412

1513
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -33,6 +31,9 @@ RUN set -e; \
3331
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
3432
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
3533
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
34+
# - Grab curl and gpg here so we cache better up above
35+
&& export DEBIAN_FRONTEND=noninteractive \
36+
&& apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \
3637
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
3738
&& export GNUPGHOME="$(mktemp -d)" \
3839
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \

0 commit comments

Comments
 (0)