-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (44 loc) · 1.38 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
FROM fedora:latest
# Install documentation for packages
RUN sed -i '/^tsflags=nodocs/d' /etc/dnf/dnf.conf \
&& dnf reinstall -y '*' \
&& dnf install -y man man-pages
# Install packages
RUN dnf install -y \
git \
stow \
zsh \
tmux \
fzf \
neovim \
zoxide \
nodejs \
ripgrep \
fd-find \
# Suggested build environment for pyenv
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite \
sqlite-devel openssl-devel tk-devel libffi-devel xz-devel libuuid-devel \
gdbm-libs libnsl2 \
&& dnf clean all
# Create a user with administrative privileges and zsh as default shell
RUN useradd --groups wheel --create-home --shell /bin/zsh admin \
&& echo "%wheel ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
USER admin
WORKDIR /home/admin
# Install pyenv
RUN curl https://pyenv.run | bash
# Sync dotfiles
COPY --chown=admin . dotfiles
RUN cd dotfiles \
&& stow --adopt */ \
&& git restore */
# Install neovim plugins that don't require user credentials
RUN echo "export NO_ASKPASS=1" >> ~/.config/zsh/zshrc.d/90-user.zsh
RUN nvim --headless "+Lazy! install" +qa
# Set locale for tmux to render nerd fonts properly
RUN echo "export LANG=C.UTF-8" >> ~/.config/zsh/zshrc.d/90-user.zsh
# Set entry point and default command
USER root
ENTRYPOINT ["/home/admin/dotfiles/entrypoint"]
CMD ["zsh"]