2021-11-29 19:00:15 +01:00
|
|
|
|
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal
|
2020-05-18 02:40:11 +02:00
|
|
|
|
|
|
|
|
|
# set version label
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
|
ARG VERSION
|
|
|
|
|
ARG CODE_RELEASE
|
|
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
|
|
|
LABEL maintainer="aptalca"
|
|
|
|
|
|
|
|
|
|
# environment settings
|
|
|
|
|
ENV HOME="/config"
|
|
|
|
|
|
|
|
|
|
RUN \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
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 && \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
echo "**** install code-server ****" && \
|
|
|
|
|
if [ -z ${CODE_RELEASE+x} ]; then \
|
2022-02-20 21:51:53 +01:00
|
|
|
|
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||'); \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
fi && \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
mkdir -p /app/code-server && \
|
2022-02-20 21:51:53 +01:00
|
|
|
|
curl -o \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
/tmp/code-server.tar.gz -L \
|
2022-02-21 03:47:30 +01:00
|
|
|
|
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-arm64.tar.gz" && \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
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 && \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
echo "**** clean up ****" && \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
apt-get purge --auto-remove -y \
|
|
|
|
|
build-essential \
|
|
|
|
|
nodejs && \
|
|
|
|
|
apt-get clean && \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
rm -rf \
|
2021-11-29 19:00:15 +01:00
|
|
|
|
/config/* \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
/tmp/* \
|
|
|
|
|
/var/lib/apt/lists/* \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
/var/tmp/* \
|
|
|
|
|
/etc/apt/sources.list.d/nodesource.list
|
2020-05-18 02:40:11 +02:00
|
|
|
|
|
|
|
|
|
# add local files
|
|
|
|
|
COPY /root /
|
|
|
|
|
|
|
|
|
|
# ports and volumes
|
|
|
|
|
EXPOSE 8443
|