forked from gitpod-io/openvscode-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.Dockerfile
89 lines (75 loc) · 3.06 KB
/
.gitpod.Dockerfile
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
85
86
87
88
89
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:git-core/ppa -y
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
file \
git \
gnome-keyring \
iproute2 \
libfuse2 \
libgconf-2-4 \
libgdk-pixbuf2.0-0 \
libgl1 \
libgtk-3.0 \
libsecret-1-dev \
libkrb5-dev \
libssl-dev \
libx11-dev \
libx11-xcb-dev \
libxkbfile-dev \
locales \
lsb-release \
lsof \
sudo \
wget \
xvfb \
tzdata \
unzip \
jq
### Gitpod user ###
# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
# passwordless sudo for users in the 'sudo' group
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers \
# To emulate the workspace-session behavior within dazzle build env
&& mkdir /workspace && chown -hR gitpod:gitpod /workspace
ENV HOME=/home/gitpod
WORKDIR $HOME
# custom Bash prompt
RUN { echo && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 \" (%s)\") $ '" ; } >> .bashrc
### Gitpod user (2) ###
USER gitpod
# use sudo so that user does not get sudo usage info on (the first) login
RUN sudo echo "Running 'sudo' for Gitpod: success" && \
# create .bashrc.d folder and source it in the bashrc
mkdir -p /home/gitpod/.bashrc.d && \
(echo; echo "for i in \$(ls -A \$HOME/.bashrc.d/); do source \$HOME/.bashrc.d/\$i; done"; echo) >> /home/gitpod/.bashrc && \
# create a completions dir for gitpod user
mkdir -p /home/gitpod/.local/share/bash-completion/completions
# Custom PATH additions
ENV PATH=$HOME/.local/bin:/usr/games:$PATH
RUN cd /home/gitpod && \
mkdir custom_node && \
wget https://unofficial-builds.nodejs.org/download/release/v18.16.1/node-v18.16.1-linux-x64-glibc-217.tar.gz && \
tar -xzf node-v18.16.1-linux-x64-glibc-217.tar.gz -C custom_node --strip-components 1
ENV GP_VSCODE_NODE=/home/gitpod/custom_node/bin/node
USER gitpod
# # We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
# RUN bash -c ". .nvm/nvm.sh \
# && nvm install 20 \
# && nvm use 20 \
# && nvm alias default 20"
# RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
# # Install dependencies
# RUN sudo apt-get update \
# && sudo apt-get install -y --no-install-recommends \
# xvfb x11vnc fluxbox dbus-x11 x11-utils x11-xserver-utils xdg-utils \
# fbautostart xterm eterm gnome-terminal gnome-keyring seahorse nautilus \
# libx11-dev libxkbfile-dev libsecret-1-dev libnotify4 libnss3 libxss1 \
# libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
# fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
# && sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*