Skip to content

Commit 7fb25d3

Browse files
authored
Merge pull request #32 from linuxserver/yarn
shrink image, install via yarn, fix arm build
2 parents 7fcde50 + 0b97beb commit 7fb25d3

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN \
1818
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
1919
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
2020
> /etc/apt/sources.list.d/nodesource.list && \
21+
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
22+
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
23+
> /etc/apt/sources.list.d/yarn.list && \
2124
echo "**** install build dependencies ****" && \
2225
apt-get update && \
2326
apt-get install -y \
@@ -33,14 +36,17 @@ RUN \
3336
nano \
3437
net-tools \
3538
nodejs \
36-
sudo && \
39+
sudo \
40+
yarn && \
3741
echo "**** install code-server ****" && \
3842
if [ -z ${CODE_RELEASE+x} ]; then \
3943
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
4044
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
4145
fi && \
4246
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
43-
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
47+
yarn --production global add code-server@"$CODE_VERSION" && \
48+
yarn cache clean && \
49+
ln -s /node_modules/.bin/code-server /usr/bin/code-server && \
4450
echo "**** clean up ****" && \
4551
apt-get purge --auto-remove -y \
4652
build-essential \

Dockerfile.aarch64

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN \
1818
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
1919
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
2020
> /etc/apt/sources.list.d/nodesource.list && \
21+
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
22+
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
23+
> /etc/apt/sources.list.d/yarn.list && \
2124
echo "**** install build dependencies ****" && \
2225
apt-get update && \
2326
apt-get install -y \
@@ -33,14 +36,17 @@ RUN \
3336
nano \
3437
net-tools \
3538
nodejs \
36-
sudo && \
39+
sudo \
40+
yarn && \
3741
echo "**** install code-server ****" && \
3842
if [ -z ${CODE_RELEASE+x} ]; then \
3943
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
4044
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
4145
fi && \
4246
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
43-
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
47+
yarn --production global add code-server@"$CODE_VERSION" && \
48+
yarn cache clean && \
49+
ln -s /node_modules/.bin/code-server /usr/bin/code-server && \
4450
echo "**** clean up ****" && \
4551
apt-get purge --auto-remove -y \
4652
build-essential \

Dockerfile.armhf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN \
1818
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
1919
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
2020
> /etc/apt/sources.list.d/nodesource.list && \
21+
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
22+
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
23+
> /etc/apt/sources.list.d/yarn.list && \
2124
echo "**** install build dependencies ****" && \
2225
apt-get update && \
2326
apt-get install -y \
@@ -33,14 +36,17 @@ RUN \
3336
nano \
3437
net-tools \
3538
nodejs \
36-
sudo && \
39+
sudo \
40+
yarn && \
3741
echo "**** install code-server ****" && \
3842
if [ -z ${CODE_RELEASE+x} ]; then \
3943
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
4044
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
4145
fi && \
4246
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
43-
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
47+
yarn --production global add code-server@"$CODE_VERSION" && \
48+
yarn cache clean && \
49+
ln -s /node_modules/.bin/code-server /usr/bin/code-server && \
4450
echo "**** clean up ****" && \
4551
apt-get purge --auto-remove -y \
4652
build-essential \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
236236

237237
## Versions
238238

239+
* **21.05.20:** - Shrink images, install via yarn, fix arm32v7 build.
239240
* **18.05.20:** - Switch to multi-arch images, install via npm.
240241
* **29.04.20:** - Update start arguments.
241242
* **01.04.20:** - Structural changes required for v3.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ app_setup_block: |
6767
6868
# changelog
6969
changelogs:
70+
- { date: "21.05.20:", desc: "Shrink images, install via yarn, fix arm32v7 build." }
7071
- { date: "18.05.20:", desc: "Switch to multi-arch images, install via npm." }
7172
- { date: "29.04.20:", desc: "Update start arguments." }
7273
- { date: "01.04.20:", desc: "Structural changes required for v3." }

0 commit comments

Comments
 (0)