use official tarballs and patch arm builds

This commit is contained in:
aptalca 2022-02-20 21:04:50 -05:00 committed by Ryan Kuba
parent 29c861029a
commit b087315336
7 changed files with 100 additions and 17 deletions

View File

@ -11,21 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ 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 ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ 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||'); \ | awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \ fi && \
mkdir -p /app/code-server && \
curl -o \ curl -o \
/tmp/code-server.deb -L \ /tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_amd64.deb" && \ "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
dpkg -i /tmp/code-server.deb && \ 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 ****" && \ echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \
rm -rf \ rm -rf \
/config/* \ /config/* \
/tmp/* \ /tmp/* \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/* \
/etc/apt/sources.list.d/nodesource.list
# add local files # add local files
COPY /root / COPY /root /

View File

@ -11,21 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ 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 ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ 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||'); \ | awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \ fi && \
mkdir -p /app/code-server && \
curl -o \ curl -o \
/tmp/code-server.deb -L \ /tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_arm64.deb" && \ "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
dpkg -i /tmp/code-server.deb && \ 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 ****" && \ echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \
rm -rf \ rm -rf \
/config/* \ /config/* \
/tmp/* \ /tmp/* \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/* \
/etc/apt/sources.list.d/nodesource.list
# add local files # add local files
COPY /root / COPY /root /

View File

@ -11,25 +11,50 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ 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 update && \
apt-get install -y \ 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 ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ 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||'); \ | awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \ fi && \
mkdir -p /app/code-server && \
curl -o \ curl -o \
/tmp/code-server.deb -L \ /tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_armhf.deb" && \ "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \
dpkg -i /tmp/code-server.deb && \ 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 ****" && \ echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
nodejs && \
apt-get clean && \ apt-get clean && \
rm -rf \ rm -rf \
/config/* \ /config/* \
/tmp/* \ /tmp/* \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/* \
/etc/apt/sources.list.d/nodesource.list
# add local files # add local files
COPY /root / COPY /root /

View File

@ -266,7 +266,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions ## 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. * **29.12.21:** - Add `install-extension` as a helper for mods to install extensions.
* **06.12.21:** - Add `DEFAULT_WORKSPACE` env var. * **06.12.21:** - Add `DEFAULT_WORKSPACE` env var.
* **29.11.21:** - Rebase to Ubuntu focal. * **29.11.21:** - Rebase to Ubuntu focal.

View File

@ -77,7 +77,7 @@ app_setup_block: |
# changelog # changelog
changelogs: 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: "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: "06.12.21:", desc: "Add `DEFAULT_WORKSPACE` env var." }
- { date: "29.11.21:", desc: "Rebase to Ubuntu focal." } - { date: "29.11.21:", desc: "Rebase to Ubuntu focal." }

View File

@ -15,7 +15,7 @@ fi
exec \ exec \
s6-setuidgid abc \ s6-setuidgid abc \
/usr/lib/code-server/bin/code-server \ /app/code-server/bin/code-server \
--bind-addr 0.0.0.0:8443 \ --bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \ --user-data-dir /config/data \
--extensions-dir /config/extensions \ --extensions-dir /config/extensions \

View File

@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# shellcheck shell=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 if [ "$(whoami)" == "abc" ]; then
"${_install[@]}" "$@" "${_install[@]}" "$@"