Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +96 -18
Dockerfile
CHANGED
@@ -1,24 +1,102 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
RUN curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -\
|
13 |
&& apt install nodejs
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
EXPOSE 7860
|
23 |
|
24 |
-
ENTRYPOINT [ "/bin/sh", "-c", "exec ${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token
|
|
|
1 |
+
FROM buildpack-deps:22.04-curl
|
2 |
|
3 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
4 |
+
ansible \
|
5 |
+
git \
|
6 |
+
unzip \
|
7 |
+
xz-utils \
|
8 |
+
openssh-client \
|
9 |
+
openssl \
|
10 |
+
dnsutils \
|
11 |
+
curl \
|
12 |
+
sudo \
|
13 |
+
screen \
|
14 |
+
smbclient \
|
15 |
+
wget \
|
16 |
+
rsync \
|
17 |
+
whois \
|
18 |
+
netcat \
|
19 |
+
nmap \
|
20 |
+
terminator \
|
21 |
+
tmux \
|
22 |
+
vim \
|
23 |
+
neofetch \
|
24 |
+
wget \
|
25 |
+
curl \
|
26 |
+
net-tools \
|
27 |
+
locales \
|
28 |
+
bzip2 \
|
29 |
+
python3-numpy \
|
30 |
+
supervisor \
|
31 |
+
xdotool \
|
32 |
+
zsh \
|
33 |
+
&& rm -rf /var/lib/apt/lists/*
|
34 |
RUN curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -\
|
35 |
&& apt install nodejs
|
36 |
+
WORKDIR /home/
|
37 |
+
|
38 |
+
ARG RELEASE_TAG="openvscode-server-v1.82.2"
|
39 |
+
ARG RELEASE_ORG="gitpod-io"
|
40 |
+
ARG OPENVSCODE_SERVER_ROOT="/home/.openvscode-server"
|
41 |
+
|
42 |
+
# Downloading the latest VSC Server release and extracting the release archive
|
43 |
+
# Rename `openvscode-server` cli tool to `code` for convenience
|
44 |
+
RUN if [ -z "${RELEASE_TAG}" ]; then \
|
45 |
+
echo "The RELEASE_TAG build arg must be set." >&2 && \
|
46 |
+
exit 1; \
|
47 |
+
fi && \
|
48 |
+
arch=$(uname -m) && \
|
49 |
+
if [ "${arch}" = "x86_64" ]; then \
|
50 |
+
arch="x64"; \
|
51 |
+
elif [ "${arch}" = "aarch64" ]; then \
|
52 |
+
arch="arm64"; \
|
53 |
+
elif [ "${arch}" = "armv7l" ]; then \
|
54 |
+
arch="armhf"; \
|
55 |
+
fi && \
|
56 |
+
wget https://github.com/${RELEASE_ORG}/openvscode-server/releases/download/${RELEASE_TAG}/${RELEASE_TAG}-linux-${arch}.tar.gz && \
|
57 |
+
tar -xzf ${RELEASE_TAG}-linux-${arch}.tar.gz && \
|
58 |
+
mv -f ${RELEASE_TAG}-linux-${arch} ${OPENVSCODE_SERVER_ROOT} && \
|
59 |
+
cp ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/openvscode-server ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/code && \
|
60 |
+
rm -f ${RELEASE_TAG}-linux-${arch}.tar.gz
|
61 |
+
|
62 |
+
ARG USERNAME=user
|
63 |
+
ARG USER_UID=1000
|
64 |
+
ARG USER_GID=$USER_UID
|
65 |
+
|
66 |
+
# Creating the user and usergroup
|
67 |
+
RUN groupadd --gid $USER_GID $USERNAME \
|
68 |
+
&& useradd --uid $USER_UID --gid $USERNAME -m -s /bin/bash $USERNAME \
|
69 |
+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
70 |
+
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
71 |
+
|
72 |
+
RUN chmod g+rw /home && \
|
73 |
+
mkdir -p /home/workspace && \
|
74 |
+
chown -R $USERNAME:$USERNAME /home/workspace && \
|
75 |
+
chown -R $USERNAME:$USERNAME ${OPENVSCODE_SERVER_ROOT}
|
76 |
+
|
77 |
+
USER $USERNAME
|
78 |
+
|
79 |
+
WORKDIR /home/workspace/
|
80 |
+
|
81 |
+
ENV LANG=C.UTF-8 \
|
82 |
+
LC_ALL=C.UTF-8 \
|
83 |
+
HOME=/home/workspace \
|
84 |
+
EDITOR=code \
|
85 |
+
VISUAL=code \
|
86 |
+
GIT_EDITOR="code --wait" \
|
87 |
+
OPENVSCODE_SERVER_ROOT=${OPENVSCODE_SERVER_ROOT}
|
88 |
+
|
89 |
+
# Install Softwares
|
90 |
+
RUN yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
91 |
+
RUN sudo chsh -s ~/.zshrc
|
92 |
+
|
93 |
+
# Install VS Code Extensions
|
94 |
+
ENV OPENVSCODE="${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server"
|
95 |
+
RUN ${OPENVSCODE} --install-extension ms-python.python && \
|
96 |
+
${OPENVSCODE} --install-extension monokai.theme-monokai-pro-vscode
|
97 |
+
|
98 |
+
RUN sudo mkdir -p /data && sudo chown $USERNAME: /data
|
99 |
|
100 |
EXPOSE 7860
|
101 |
|
102 |
+
ENTRYPOINT [ "/bin/sh", "-c", "exec ${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token"]
|