-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
81 lines (72 loc) · 2.06 KB
/
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
FROM ubuntu:focal
COPY install-packages /usr/bin
### base ###
ARG DEBIAN_FRONTEND=noninteractive
RUN yes | unminimize \
&& install-packages \
zip \
unzip \
bash-completion \
build-essential \
htop \
less \
locales \
software-properties-common \
sudo \
time \
vim \
ssl-cert \
git \
python3-pip \
gawk \
wget \
diffstat \
unzip \
texinfo \
gcc \
build-essential \
chrpath \
socat \
cpio \
python3 \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libegl1-mesa \
libsdl1.2-dev \
pylint3 \
xterm \
python3-subunit \
mesa-common-dev \
lz4 \
zstd \
file \
iproute2 \
openssh-client \
tree \
novnc \
net-tools \
&& locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN pip3 install kas==2.5
# add redirect so the preview works nicely
COPY novnc-index.html /usr/share/novnc/index.html
### 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
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