-
Notifications
You must be signed in to change notification settings - Fork 382
/
default.sh
executable file
·32 lines (31 loc) · 1.42 KB
/
default.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash
# The following is borrowed from https://github.com/nodejs/docker-node/blob/main/16/bullseye-slim/Dockerfile
set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$1/yarn-v$1.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$1/yarn-v$1.tar.gz.asc" \
&& gpg --batch --verify yarn-v$1.tar.gz.asc yarn-v$1.tar.gz \
&& mkdir -p /opt \
&& tar -xzf yarn-v$1.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$1/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$1/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$1.tar.gz.asc yarn-v$1.tar.gz \
&& apt-mark auto '.*' > /dev/null \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& yarn --version