72 lines
2.2 KiB
Docker
72 lines
2.2 KiB
Docker
# syntax=docker/dockerfile:1
|
||
|
||
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
|
||
|
||
# set version label
|
||
ARG BUILD_DATE
|
||
ARG VERSION
|
||
ARG CODE_RELEASE
|
||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||
LABEL maintainer="Roxedus"
|
||
|
||
# environment settings
|
||
ARG DEBIAN_FRONTEND="noninteractive"
|
||
ENV HOME="/config" \
|
||
VSCODE_SERVER_DATA_DIR="/app/vscode-server" \
|
||
S6_STAGE2_HOOK="/init-hook"
|
||
|
||
RUN \
|
||
echo "**** install runtime dependencies ****" && \
|
||
apt-get update && \
|
||
apt-get install -y \
|
||
dbus-x11 \
|
||
git \
|
||
nano \
|
||
net-tools \
|
||
netcat \
|
||
sudo && \
|
||
apt-get install -y --no-install-recommends \
|
||
gnome-keyring \
|
||
libatomic1 \
|
||
libsecret-1-dev && \
|
||
echo "**** install vscode-server ****" && \
|
||
if [ -z ${CODE_RELEASE+x} ]; then \
|
||
CODE_RELEASE=$(curl -sLX GET "https://update.code.visualstudio.com/api/latest/server-linux-x64-web/insider" \
|
||
| jq '.version' -r); \
|
||
fi && \
|
||
if [ -z ${CLI_RELEASE+x} ]; then \
|
||
CLI_RELEASE=$(curl -sLX GET "https://vscodeserverlauncher.blob.core.windows.net/builds/latest" \
|
||
| jq '.version' -r); \
|
||
fi && \
|
||
mkdir -p /usr/local/bin && \
|
||
mkdir -p /app/vscode-server/server-insiders-web/bin/${CODE_RELEASE} && \
|
||
mkdir -p /app/vscode-server/server-insiders/bin/${CODE_RELEASE} && \
|
||
curl -o \
|
||
/usr/local/bin/code-server -L \
|
||
"https://vscodeserverlauncher.blob.core.windows.net/builds/${CLI_RELEASE}/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu" && \
|
||
chmod +x /usr/local/bin/code-server && \
|
||
curl -o \
|
||
/tmp/vscode-server-web.tar.gz -L \
|
||
"https://az764295.vo.msecnd.net/insider/${CODE_RELEASE}/vscode-server-linux-x64-web.tar.gz" && \
|
||
tar xf \
|
||
/tmp/vscode-server-web.tar.gz -C \
|
||
/app/vscode-server/server-insiders-web/bin/${CODE_RELEASE}/ --strip-components=1 && \
|
||
curl -o \
|
||
/tmp/vscode-server.tar.gz -L \
|
||
"https://az764295.vo.msecnd.net/insider/${CODE_RELEASE}/vscode-server-linux-x64.tar.gz" && \
|
||
tar xf \
|
||
/tmp/vscode-server.tar.gz -C \
|
||
/app/vscode-server/server-insiders/bin/${CODE_RELEASE}/ --strip-components=1 && \
|
||
echo "**** clean up ****" && \
|
||
apt-get clean && \
|
||
rm -rf \
|
||
/tmp/* \
|
||
/var/lib/apt/lists/* \
|
||
/var/tmp/*
|
||
|
||
# add local files
|
||
COPY /root /
|
||
|
||
# ports and volumes
|
||
EXPOSE 8000
|