Skip to content

Commit

Permalink
use official tarballs and patch arm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aptalca authored and thelamer committed Feb 21, 2022
1 parent 29c8610 commit b087315
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 17 deletions.
37 changes: 33 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config"

RUN \
echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
nodejs && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
libatomic1 \
nano \
net-tools \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_amd64.deb" && \
dpkg -i /tmp/code-server.deb && \
/tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \
echo "**** patch 4.0.2 ****" && \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \
cd /app/code-server && \
npm i --production @node-rs/argon2; \
fi && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
/var/tmp/* \
/etc/apt/sources.list.d/nodesource.list

# add local files
COPY /root /
Expand Down
37 changes: 33 additions & 4 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config"

RUN \
echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
nodejs && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
libatomic1 \
nano \
net-tools \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_arm64.deb" && \
dpkg -i /tmp/code-server.deb && \
/tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \
echo "**** patch 4.0.2 ****" && \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \
cd /app/code-server && \
npm i --production @node-rs/argon2; \
fi && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
/var/tmp/* \
/etc/apt/sources.list.d/nodesource.list

# add local files
COPY /root /
Expand Down
35 changes: 30 additions & 5 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config"

RUN \
echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
libatomic1 && \
build-essential \
nodejs && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
libatomic1 \
nano \
net-tools \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_armhf.deb" && \
dpkg -i /tmp/code-server.deb && \
/tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \
echo "**** patch 4.0.2 ****" && \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \
cd /app/code-server && \
npm i --production @node-rs/argon2; \
fi && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
/var/tmp/* \
/etc/apt/sources.list.d/nodesource.list

# add local files
COPY /root /
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **20.02.22:** - Install using the official debs.
* **20.02.22:** - Install using the official tarballs.
* **29.12.21:** - Add `install-extension` as a helper for mods to install extensions.
* **06.12.21:** - Add `DEFAULT_WORKSPACE` env var.
* **29.11.21:** - Rebase to Ubuntu focal.
Expand Down
2 changes: 1 addition & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "20.02.22:", desc: "Install using the official debs." }
- { date: "20.02.22:", desc: "Install using the official tarballs." }
- { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." }
- { date: "06.12.21:", desc: "Add `DEFAULT_WORKSPACE` env var." }
- { date: "29.11.21:", desc: "Rebase to Ubuntu focal." }
Expand Down
2 changes: 1 addition & 1 deletion root/etc/services.d/code-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi

exec \
s6-setuidgid abc \
/usr/lib/code-server/bin/code-server \
/app/code-server/bin/code-server \
--bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \
--extensions-dir /config/extensions \
Expand Down
2 changes: 1 addition & 1 deletion root/usr/local/bin/install-extension
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

_install=(/usr/local/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension")
_install=(/app/code-server/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension")

if [ "$(whoami)" == "abc" ]; then
"${_install[@]}" "$@"
Expand Down

0 comments on commit b087315

Please sign in to comment.