2022-09-29 15:40:19 +02:00
|
|
|
|
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
|
2019-06-24 20:03:06 +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
|
2022-09-29 15:40:19 +02:00
|
|
|
|
ARG DEBIAN_FRONTEND="noninteractive"
|
2019-06-24 20:03:06 +02:00
|
|
|
|
ENV HOME="/config"
|
|
|
|
|
|
|
|
|
|
RUN \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
echo "**** install runtime dependencies ****" && \
|
2022-09-29 15:40:19 +02:00
|
|
|
|
apt-get update && \
|
2022-10-05 18:21:53 +02:00
|
|
|
|
apt-get install -y \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
git \
|
|
|
|
|
jq \
|
|
|
|
|
libatomic1 \
|
|
|
|
|
nano \
|
|
|
|
|
net-tools \
|
2022-09-29 17:37:34 +02:00
|
|
|
|
netcat \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
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 \
|
2022-09-29 15:40:19 +02:00
|
|
|
|
| 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-amd64.tar.gz" && \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
tar xf /tmp/code-server.tar.gz -C \
|
|
|
|
|
/app/code-server --strip-components=1 && \
|
2021-05-08 16:50:21 +02:00
|
|
|
|
echo "**** clean up ****" && \
|
2022-02-21 03:04:50 +01:00
|
|
|
|
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-09-29 15:40:19 +02:00
|
|
|
|
/var/tmp/*
|
2019-06-24 20:03:06 +02:00
|
|
|
|
|
|
|
|
|
# add local files
|
|
|
|
|
COPY /root /
|
|
|
|
|
|
|
|
|
|
# ports and volumes
|
2023-02-22 10:04:42 +01:00
|
|
|
|
EXPOSE 8443 8888 8889
|