Skip to content

Commit 0a30cb4

Browse files
committed
Let apt-get download drop privileges for the download
+ Adjust whitespace style by letting short closely related commands appear on the same line. Broadly speaking, this style is often not clearer, but in this case, especially with the new commands here, it seems to improve clarity. (Though maybe not as much as breaking the `RUN` contents out into a script file, where they could instead be easily grouped with whitespace and comments.)
1 parent 09392e9 commit 0a30cb4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

etc/docker/Dockerfile.test-cross

+5-8
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ RUN set -uC && \
2525
apt-get install --no-install-recommends -y "libc6$apt_suffix" "libcurl3-gnutls$apt_suffix" \
2626
"libexpat1$apt_suffix" "libpcre2-8-0$apt_suffix" "zlib1g$apt_suffix" perl liberror-perl \
2727
git-man file jq patch && \
28-
apt-get download "git$apt_suffix" && \
29-
dpkg --ignore-depends="perl$apt_suffix,liberror-perl$apt_suffix" -i git[-_]*.deb && \
30-
git version --build-options && \
31-
git="$(command -v git)" && \
32-
file -- "$git" && \
33-
rm git[-_]*.deb && \
34-
apt-get clean && \
35-
rm -rf /var/lib/apt/lists/* && \
28+
mkdir /tmp/dl && chown _apt /tmp/dl && \
29+
(cd /tmp/dl && apt-get download "git$apt_suffix") && \
30+
dpkg --ignore-depends="perl$apt_suffix,liberror-perl$apt_suffix" -i /tmp/dl/git[-_]*.deb && \
31+
git version --build-options && git="$(command -v git)" && file -- "$git" && \
32+
apt-get clean && rm -rf /tmp/dl /var/lib/apt/lists/* && \
3633
if test -f /android-runner; then \
3734
sed -i.orig 's/^export LD_PRELOAD=/test "${NO_PRELOAD_CXX:-0}" != 0 || &/' \
3835
/android-runner; \

0 commit comments

Comments
 (0)