ls-code-server/Dockerfile

46 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2020-11-02 16:13:45 +01:00
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic
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
ENV HOME="/config"
RUN \
2020-03-05 22:15:55 +01:00
echo "**** install dependencies ****" && \
2019-06-24 20:03:06 +02:00
apt-get update && \
apt-get install -y \
2019-06-24 21:42:04 +02:00
git \
2019-09-18 22:21:56 +02:00
jq \
2019-07-01 21:48:53 +02:00
nano \
net-tools \
sudo && \
2019-06-24 20:03:06 +02:00
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
2019-09-18 22:21:56 +02:00
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases" \
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \
2019-06-24 20:03:06 +02:00
fi && \
2020-03-05 22:15:55 +01:00
CODE_URL=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/tags/${CODE_RELEASE}" \
| jq -r '.assets[] | select(.browser_download_url | contains("linux-x86_64")) | .browser_download_url') && \
mkdir -p /app/code-server && \
2019-06-24 20:03:06 +02:00
curl -o \
2020-03-05 22:15:55 +01:00
/tmp/code.tar.gz -L \
"${CODE_URL}" && \
2019-06-24 20:03:06 +02:00
tar xzf /tmp/code.tar.gz -C \
2020-03-05 22:15:55 +01:00
/app/code-server --strip-components=1 && \
2019-06-24 20:03:06 +02:00
echo "**** clean up ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY /root /
# ports and volumes
EXPOSE 8443