-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (33 loc) · 1.37 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
from ubuntu:20.04
# Noninteractive install
ENV DEBIAN_FRONTEND noninteractive
# Install core software
RUN apt-get update -q && \
apt-get upgrade -yq && \
apt-get install -yq apt-transport-https software-properties-common build-essential curl git sudo \
ca-certificates gnupg \
tmux unzip wget zsh ripgrep fd-find \
python3-dev python3-pip python3-setuptools
# Install a more recent version of neovim
RUN add-apt-repository ppa:neovim-ppa/stable && apt-get update -q && apt-get install -yq neovim
# Install nodejs
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update -q && apt-get install -yq nodejs
# Create user
RUN useradd kwsp && \
echo "kwsp ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/kwsp && \
chmod 0440 /etc/sudoers.d/kwsp && \
mkdir -p /home/kwsp && \
chown kwsp:kwsp /home/kwsp && \
chsh -s /usr/bin/zsh kwsp
# Copy dotfiles
COPY . /home/kwsp/dotfiles
RUN chown -R kwsp:kwsp /home/kwsp/dotfiles
USER kwsp
WORKDIR /home/kwsp
ENV SHELL /usr/bin/zsh
# Install dotfiles, oh my zsh, oh my tmux, vim plug etc
RUN cd /home/kwsp/dotfiles && ./install.sh
CMD /usr/bin/zsh