Skip to content

Commit a1fa7f0

Browse files
aptalcathelamer
authored andcommitted
install using official debs
1 parent 16909c6 commit a1fa7f0

File tree

9 files changed

+24
-127
lines changed

9 files changed

+24
-127
lines changed

.github/workflows/external_trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fi
1919
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\". ****"
2020
echo "**** Retrieving external version ****"
21-
EXT_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '."dist-tags".latest' | sed 's|^|v|')
21+
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||')
2222
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2323
echo "**** Can't retrieve external version, exiting ****"
2424
FAILURE_REASON="Can't retrieve external version for code-server branch master"

Dockerfile

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
1111
ENV HOME="/config"
1212

1313
RUN \
14-
echo "**** install node repo ****" && \
15-
apt-get update && \
16-
apt-get install -y \
17-
gnupg && \
18-
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
19-
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
20-
> /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 && \
24-
echo "**** install build dependencies ****" && \
25-
apt-get update && \
26-
apt-get install -y \
27-
build-essential \
28-
libx11-dev \
29-
libxkbfile-dev \
30-
pkg-config \
31-
python3 && \
32-
echo "**** install runtime dependencies ****" && \
33-
apt-get install -y \
34-
git \
35-
jq \
36-
nano \
37-
net-tools \
38-
nodejs \
39-
sudo \
40-
yarn && \
4114
echo "**** install code-server ****" && \
4215
if [ -z ${CODE_RELEASE+x} ]; then \
43-
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
44-
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
16+
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
17+
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
4518
fi && \
46-
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
47-
npm config set python python3 && \
48-
yarn config set network-timeout 600000 -g && \
49-
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
50-
yarn cache clean && \
19+
curl -o \
20+
/tmp/code-server.deb -L \
21+
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_amd64.deb" && \
22+
dpkg -i /tmp/code-server.deb && \
5123
echo "**** clean up ****" && \
52-
apt-get purge --auto-remove -y \
53-
build-essential \
54-
libx11-dev \
55-
libxkbfile-dev \
56-
libsecret-1-dev \
57-
pkg-config && \
58-
apt-get clean && \
5924
rm -rf \
6025
/config/* \
6126
/tmp/* \

Dockerfile.aarch64

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
1111
ENV HOME="/config"
1212

1313
RUN \
14-
echo "**** install node repo ****" && \
15-
apt-get update && \
16-
apt-get install -y \
17-
gnupg && \
18-
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
19-
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
20-
> /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 && \
24-
echo "**** install build dependencies ****" && \
25-
apt-get update && \
26-
apt-get install -y \
27-
build-essential \
28-
libx11-dev \
29-
libxkbfile-dev \
30-
pkg-config \
31-
python3 && \
32-
echo "**** install runtime dependencies ****" && \
33-
apt-get install -y \
34-
git \
35-
jq \
36-
nano \
37-
net-tools \
38-
nodejs \
39-
sudo \
40-
yarn && \
4114
echo "**** install code-server ****" && \
4215
if [ -z ${CODE_RELEASE+x} ]; then \
43-
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
44-
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
16+
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
17+
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
4518
fi && \
46-
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
47-
npm config set python python3 && \
48-
yarn config set network-timeout 600000 -g && \
49-
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
50-
yarn cache clean && \
19+
curl -o \
20+
/tmp/code-server.deb -L \
21+
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_arm64.deb" && \
22+
dpkg -i /tmp/code-server.deb && \
5123
echo "**** clean up ****" && \
52-
apt-get purge --auto-remove -y \
53-
build-essential \
54-
libx11-dev \
55-
libxkbfile-dev \
56-
libsecret-1-dev \
57-
pkg-config && \
58-
apt-get clean && \
5924
rm -rf \
6025
/config/* \
6126
/tmp/* \

Dockerfile.armhf

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
1111
ENV HOME="/config"
1212

1313
RUN \
14-
echo "**** install node repo ****" && \
15-
apt-get update && \
16-
apt-get install -y \
17-
gnupg && \
18-
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
19-
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
20-
> /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 && \
24-
echo "**** install build dependencies ****" && \
25-
apt-get update && \
26-
apt-get install -y \
27-
build-essential \
28-
libx11-dev \
29-
libxkbfile-dev \
30-
pkg-config \
31-
python3 && \
32-
echo "**** install runtime dependencies ****" && \
33-
apt-get install -y \
34-
git \
35-
jq \
36-
nano \
37-
net-tools \
38-
nodejs \
39-
sudo \
40-
yarn && \
4114
echo "**** install code-server ****" && \
4215
if [ -z ${CODE_RELEASE+x} ]; then \
43-
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
44-
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
16+
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
17+
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
4518
fi && \
46-
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
47-
npm config set python python3 && \
48-
yarn config set network-timeout 600000 -g && \
49-
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
50-
yarn cache clean && \
19+
curl -o \
20+
/tmp/code-server.deb -L \
21+
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_armhf.deb" && \
22+
dpkg -i /tmp/code-server.deb && \
5123
echo "**** clean up ****" && \
52-
apt-get purge --auto-remove -y \
53-
build-essential \
54-
libx11-dev \
55-
libxkbfile-dev \
56-
libsecret-1-dev \
57-
pkg-config && \
58-
apt-get clean && \
5924
rm -rf \
6025
/config/* \
6126
/tmp/* \

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pipeline {
104104
steps{
105105
script{
106106
env.EXT_RELEASE = sh(
107-
script: ''' curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '."dist-tags".latest' | sed 's|^|v|' ''',
107+
script: ''' curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||' ''',
108108
returnStdout: true).trim()
109109
env.RELEASE_LINK = 'custom_command'
110110
}

README.md

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

267267
## Versions
268268

269+
* **20.02.22:** - Install using the official debs.
269270
* **29.12.21:** - Add `install-extension` as a helper for mods to install extensions.
270271
* **06.12.21:** - Add `DEFAULT_WORKSPACE` env var.
271272
* **29.11.21:** - Rebase to Ubuntu focal.

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# jenkins variables
44
project_name: docker-code-server
55
external_type: na
6-
custom_version_command: "curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '.\"dist-tags\".latest' | sed 's|^|v|'"
6+
custom_version_command: "curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||'"
77
release_type: stable
88
release_tag: latest
99
ls_branch: master

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ app_setup_block: |
7777
7878
# changelog
7979
changelogs:
80+
- { date: "20.02.22:", desc: "Install using the official debs." }
8081
- { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." }
8182
- { date: "06.12.21:", desc: "Add `DEFAULT_WORKSPACE` env var." }
8283
- { date: "29.11.21:", desc: "Rebase to Ubuntu focal." }

root/etc/services.d/code-server/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515

1616
exec \
1717
s6-setuidgid abc \
18-
/usr/local/bin/code-server \
18+
/usr/lib/code-server/bin/code-server \
1919
--bind-addr 0.0.0.0:8443 \
2020
--user-data-dir /config/data \
2121
--extensions-dir /config/extensions \

0 commit comments

Comments
 (0)