forked from linuxserver/docker-code-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
84 lines (76 loc) · 2.92 KB
/
Copy pathDockerfile
File metadata and controls
84 lines (76 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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="aptalca"
# environment settings
ARG DEBIAN_FRONTEND="noninteractive"
ENV HOME="/config"
RUN \
echo "**** install runtime dependencies ****" && \
apt-get update && \
apt-get install -y \
git \
jq \
libatomic1 \
nano \
net-tools \
netcat \
sudo && \
echo "**** install additional packages ****" && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
build-essential \
openjdk-21-jdk \
coreutils \
rename \
curl \
wget \
tree && \
echo "**** install nvm ****" && \
nvm_version=$(basename $(curl -fs -o /dev/null -w %{redirect_url} "https://github.com/nvm-sh/nvm/releases/latest")) && \
export HOME=/opt && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | bash && \
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 "**** clean up ****" && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add nvm to path
RUN echo "export NVM_DIR=\"/opt/.nvm\"" >> /root/.bashrc && \
echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && \. \"\$NVM_DIR/nvm.sh\"" >> /root/.bashrc && \
echo "[ -s \"\$NVM_DIR/bash_completion\" ] && \. \"\$NVM_DIR/bash_completion\"" >> /root/.bashrc
# install code-server extensions
RUN \
echo "**** install code-server extensions ****" && \
/app/code-server/bin/code-server --install-extension ms-python.python && \
/app/code-server/bin/code-server --install-extension ms-python.black-formatter && \
/app/code-server/bin/code-server --install-extension ms-toolsai.jupyter && \
/app/code-server/bin/code-server --install-extension llvm-vs-code-extensions.vscode-clangd && \
/app/code-server/bin/code-server --install-extension redhat.java && \
/app/code-server/bin/code-server --install-extension esbenp.prettier-vscode && \
/app/code-server/bin/code-server --install-extension Gruntfuggly.todo-tree && \
/app/code-server/bin/code-server --install-extension mhutchie.git-graph && \
/app/code-server/bin/code-server --install-extension waderyan.gitblame && \
/app/code-server/bin/code-server --install-extension donjayamanne.githistory
RUN mv ~/.local/share/code-server/extensions /opt/extensions
# add local files
COPY /root /
# ports and volumes
EXPOSE 8443