mirror of
https://github.com/linuxserver/docker-code-server.git
synced 2025-04-16 22:59:30 +02:00
81 lines
2.5 KiB
Docker
81 lines
2.5 KiB
Docker
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal
|
||
|
||
# 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 \
|
||
echo "**** install node repo ****" && \
|
||
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
|
||
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
|
||
> /etc/apt/sources.list.d/nodesource.list && \
|
||
echo "**** install build dependencies ****" && \
|
||
apt-get update && \
|
||
apt-get install -y \
|
||
build-essential \
|
||
nodejs && \
|
||
echo "**** install runtime dependencies ****" && \
|
||
apt-get install -y \
|
||
git \
|
||
jq \
|
||
libatomic1 \
|
||
vim \
|
||
wget \
|
||
curl \
|
||
net-tools \
|
||
unzip \
|
||
sudo && \
|
||
echo "**** install code-server ****" && \
|
||
if [ -z ${CODE_RELEASE+x} ]; then \
|
||
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
|
||
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
|
||
fi && \
|
||
mkdir -p /app/code-server && \
|
||
curl -o \
|
||
/tmp/code-server.tar.gz -L \
|
||
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" && \
|
||
tar xf /tmp/code-server.tar.gz -C \
|
||
/app/code-server --strip-components=1 && \
|
||
echo "**** patch 4.0.2 ****" && \
|
||
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \
|
||
cd /app/code-server && \
|
||
npm i --production @node-rs/argon2; \
|
||
fi && \
|
||
echo "**** clean up ****" && \
|
||
apt-get purge --auto-remove -y \
|
||
build-essential \
|
||
nodejs && \
|
||
apt-get clean && \
|
||
rm -rf \
|
||
/config/* \
|
||
/tmp/* \
|
||
/var/lib/apt/lists/* \
|
||
/var/tmp/* \
|
||
/etc/apt/sources.list.d/nodesource.list
|
||
|
||
ENV TERRAFORM_VERSION=1.2.2
|
||
|
||
RUN wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
|
||
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/bin
|
||
|
||
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && \
|
||
chmod +x kubectl && \
|
||
mv kubectl /usr/bin/kubectl
|
||
|
||
RUN wget https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz && \
|
||
tar -zxvf helm-v3.9.0-linux-amd64.tar.gz && \
|
||
mv linux-amd64/helm /usr/bin/helm
|
||
|
||
|
||
# add local files
|
||
COPY /root /
|
||
|
||
# ports and volumes
|
||
EXPOSE 32773
|