mirror of
https://github.com/linuxserver/docker-code-server.git
synced 2024-11-30 07:55:40 +01:00
43 lines
1007 B
Docker
43 lines
1007 B
Docker
FROM lsiobase/ubuntu:bionic
|
||
|
||
# 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 \
|
||
apt-get update && \
|
||
apt-get install -y \
|
||
git \
|
||
jq \
|
||
nano \
|
||
net-tools \
|
||
sudo && \
|
||
echo "**** install code-server ****" && \
|
||
if [ -z ${CODE_RELEASE+x} ]; then \
|
||
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases" \
|
||
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \
|
||
fi && \
|
||
curl -o \
|
||
/tmp/code.tar.gz -L \
|
||
"https://github.com/cdr/code-server/releases/download/${CODE_RELEASE}/code-server${CODE_RELEASE}-linux-x86_64.tar.gz" && \
|
||
tar xzf /tmp/code.tar.gz -C \
|
||
/usr/bin/ --strip-components=1 \
|
||
--wildcards code-server*/code-server && \
|
||
echo "**** clean up ****" && \
|
||
rm -rf \
|
||
/tmp/* \
|
||
/var/lib/apt/lists/* \
|
||
/var/tmp/*
|
||
|
||
# add local files
|
||
COPY /root /
|
||
|
||
# ports and volumes
|
||
EXPOSE 8443
|