-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.user
53 lines (36 loc) · 2.26 KB
/
Dockerfile.user
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
FROM f0xedb/tos-base:latest
ARG user=tos
# Retreive the tos repo
RUN curl https://raw.githubusercontent.com/ODEX-TOS/tos-live/master/toslive/pacman.conf > /etc/pacman.conf
RUN pacman-key --init && pacman-key --populate
RUN pacman -Syu --overwrite="/etc/pacman.d/*" git tos-tools yay --noconfirm
# clear the pacman cache
RUN pacman -Sc --noconfirm
# create a user
RUN useradd $user && echo "$user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && chmod 0440 /etc/sudoers.d/user && mkdir -p /home/$user && chown $user:users /home/$user
# tos version
RUN curl https://raw.githubusercontent.com/ODEX-TOS/tos-live/master/toslive/version-edit.txt > /etc/version
# Setup zsh
ENV ZSH_LOAD /home/$user/.oh-my-zsh/load
ENV ZSH_PRELOAD /home/$user/.oh-my-zsh/load/preload
ENV ZSH /home/$user/.oh-my-zsh
RUN pacman -Syu zsh neofetch --noconfirm && su - $user -c "\
curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -o install.sh && \
export RUNZSH=no && \
export CHSH=no && \
sh install.sh && \
rm install.sh && \
git clone https://github.com/zsh-users/zsh-autosuggestions /home/$user/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git /home/$user/.oh-my-zsh/custom/plugins/fast-syntax-highlighting && \
git clone https://github.com/zsh-users/zsh-completions.git /home/$user/.oh-my-zsh/custom/plugins/zsh-completions && \
git clone https://github.com/marlonrichert/zsh-autocomplete.git /home/$user/.oh-my-zsh/custom/plugins/zsh-autocomplete && \
git clone https://github.com/ODEX-TOS/zsh-load /home/$user/.oh-my-zsh/load && \
curl https://raw.githubusercontent.com/ODEX-TOS/tos-live/master/_tos >/home/$user/.oh-my-zsh/custom/plugins/zsh-completions/src/_tos && \
git clone https://github.com/denysdovhan/spaceship-prompt.git /home/$user/.oh-my-zsh/custom/themes/spaceship-prompt && \
ln -s /home/$user/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme /home/$user/.oh-my-zsh/custom/themes/spaceship.zsh-theme && \
curl https://raw.githubusercontent.com/ODEX-TOS/dotfiles/master/.zshrc > /home/$user/.zshrc && \
touch /home/$user/.profile"
RUN pacman -Sc --noconfirm
RUN chsh --shell /bin/zsh $user
USER $user
CMD ["/bin/zsh"]