-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cpu
More file actions
80 lines (63 loc) · 2.74 KB
/
Copy pathDockerfile.cpu
File metadata and controls
80 lines (63 loc) · 2.74 KB
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
FROM ubuntu:20.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install basic dependencies including sudo
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
zsh \
python3 \
python3-pip \
tmux \
direnv \
bat \
software-properties-common \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Install neovim 0.10.x from GitHub releases (apt version is too old for lazy.nvim)
RUN curl -LO https://github.com/neovim/neovim/releases/download/v0.10.4/nvim-linux-x86_64.tar.gz \
&& tar xzf nvim-linux-x86_64.tar.gz -C /opt \
&& rm nvim-linux-x86_64.tar.gz \
&& ln -s /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim
# Create group and user with specific UID/GID
ARG USER_ID=1466
ARG GROUP_ID=1372
ARG USERNAME=ldevelle
ARG GROUPNAME=data
RUN groupadd -g ${GROUP_ID} ${GROUPNAME} || true \
&& useradd -u ${USER_ID} -g ${GROUP_ID} -m -s /bin/zsh ${USERNAME} \
&& usermod -aG sudo ${USERNAME} \
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Switch to the created user
USER ${USERNAME}
WORKDIR /home/${USERNAME}
# Install uv
# Download the latest installer and run it
RUN curl -fsSL https://astral.sh/uv/install.sh -o /home/${USERNAME}/uv-installer.sh \
&& sh /home/${USERNAME}/uv-installer.sh \
&& rm /home/${USERNAME}/uv-installer.sh
# Install Rust and Cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Ensure the installed binaries are on the `PATH`
ENV PATH="/home/${USERNAME}/.local/bin:/home/${USERNAME}/.cargo/bin:$PATH"
# Install du-dust using cargo
RUN cargo install du-dust
# Setup zsh and p10k
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
&& git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
RUN echo "Hello World!"
# Clone and setup dotfiles
RUN git clone https://github.com/ezalos/Setup.git \
&& cd Setup \
&& uv sync \
&& uv run python -m src_dotfiles deploy
# Install nvim plugins headlessly
RUN nvim --headless "+Lazy! sync" +qa
# Set zsh as default shell
RUN sudo chsh -s $(which zsh) ${USERNAME}
WORKDIR /home/${USERNAME}
CMD ["zsh"]