2019-06-24 20:03:06 +02:00
|
|
|
|
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 \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
echo "**** install node repo ****" && \
|
2019-06-24 20:03:06 +02:00
|
|
|
|
apt-get update && \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
apt-get install -y \
|
|
|
|
|
gnupg && \
|
|
|
|
|
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
|
|
|
|
|
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
|
|
|
|
|
> /etc/apt/sources.list.d/nodesource.list && \
|
2020-05-21 21:30:45 +02:00
|
|
|
|
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
|
|
|
|
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
|
|
|
|
|
> /etc/apt/sources.list.d/yarn.list && \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
echo "**** install build dependencies ****" && \
|
|
|
|
|
apt-get update && \
|
|
|
|
|
apt-get install -y \
|
|
|
|
|
build-essential \
|
|
|
|
|
libx11-dev \
|
|
|
|
|
libxkbfile-dev \
|
|
|
|
|
libsecret-1-dev \
|
|
|
|
|
pkg-config && \
|
|
|
|
|
echo "**** install runtime dependencies ****" && \
|
2019-06-24 20:03:06 +02:00
|
|
|
|
apt-get install -y \
|
2019-06-24 21:42:04 +02:00
|
|
|
|
git \
|
2020-01-18 04:38:58 +01:00
|
|
|
|
jq \
|
2019-07-01 21:48:53 +02:00
|
|
|
|
nano \
|
2019-07-09 23:29:50 +02:00
|
|
|
|
net-tools \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
nodejs \
|
2020-05-21 21:30:45 +02:00
|
|
|
|
sudo \
|
|
|
|
|
yarn && \
|
2019-06-24 20:03:06 +02:00
|
|
|
|
echo "**** install code-server ****" && \
|
|
|
|
|
if [ -z ${CODE_RELEASE+x} ]; then \
|
|
|
|
|
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
|
|
|
|
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
|
|
|
|
fi && \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
|
2020-09-02 10:11:32 +02:00
|
|
|
|
yarn --production --frozen-lockfile global add code-server@"$CODE_VERSION" && \
|
2020-05-21 21:30:45 +02:00
|
|
|
|
yarn cache clean && \
|
2019-06-24 20:03:06 +02:00
|
|
|
|
echo "**** clean up ****" && \
|
2020-05-18 02:40:11 +02:00
|
|
|
|
apt-get purge --auto-remove -y \
|
|
|
|
|
build-essential \
|
|
|
|
|
libx11-dev \
|
|
|
|
|
libxkbfile-dev \
|
|
|
|
|
libsecret-1-dev \
|
|
|
|
|
pkg-config && \
|
|
|
|
|
apt-get clean && \
|
2019-06-24 20:03:06 +02:00
|
|
|
|
rm -rf \
|
|
|
|
|
/tmp/* \
|
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
|
/var/tmp/*
|
|
|
|
|
|
|
|
|
|
# add local files
|
|
|
|
|
COPY /root /
|
|
|
|
|
|
|
|
|
|
# ports and volumes
|
|
|
|
|
EXPOSE 8443
|