-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (57 loc) · 1.92 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
ARG GROUP_ID=1001
ARG USER_ID=1001
ARG ARCH_BASE_IMAGE
FROM docker.io/${ARCH_BASE_IMAGE} AS x11_arch
RUN pacman -Sy --disable-download-timeout --noconfirm \
archlinux-keyring \
&& pacman -Sy --disable-download-timeout --noconfirm \
base-devel \
binutils \
fakeroot \
firefox \
git \
gnome-keyring \
mesa \
openssh \
sudo \
procps \
pulseaudio \
pulseaudio-alsa \
python \
xorg-server \
xorg-apps \
&& /bin/bash /root/skim.sh
ARG WITH_CUDA
RUN [ -n "${WITH_CUDA}" ] \
&& pacman -Sy --disable-download-timeout --noconfirm \
nvidia \
cuda \
cudnn \
|| echo "Not installing CUDA"
RUN sed -i -- 's/#[ ]*\(%wheel[ ]*ALL[ ]*=[ ]*([ ]*ALL[ ]*:[ ]*ALL[ ]*)[ ]*NOPASSWD[ ]*:[ ]*ALL\)$/\1/gw /tmp/sed.done' /etc/sudoers \
&& [ -z "$(cat /tmp/sed.done | wc -l)" ] && echo "Failed to enable sudo for wheel group" && exit 1 \
|| echo "Enabled sudo for wheel group" && rm /tmp/sed.done
ARG GROUP_ID
ARG USER_ID
ARG USER_NAME
RUN groupadd -g $GROUP_ID $USER_NAME \
&& useradd -u $USER_ID -g $GROUP_ID -G wheel -m $USER_NAME
USER $USER_NAME
RUN cd /tmp \
&& git clone https://aur.archlinux.org/trizen.git \
&& cd trizen \
&& makepkg -si --noconfirm \
&& cd / \
&& rm -r /tmp/trizen
RUN cd /tmp \
&& trizen -S --noconfirm windsurf windsurf-features windsurf-marketplace \
&& rm -rf /tmp/windsurf* \
&& trizen -Scc --aur --noconfirm
USER root
RUN sed -i -- 's/^[ ]*\(%wheel[ ]*ALL[ ]*=[ ]*([ ]*ALL[ ]*:[ ]*ALL[ ]*)[ ]*NOPASSWD[ ]*:[ ]*ALL\)$/# \1/gw /tmp/sed.done' /etc/sudoers \
&& [ -z "$(cat /tmp/sed.done | wc -l)" ] && echo "Failed to disable sudo for wheel group" && exit 1 \
|| echo "Disabled sudo for wheel group" && rm /tmp/sed.done
USER $USER_NAME
COPY docker_files/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
CMD []