-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.arch
50 lines (39 loc) · 1.32 KB
/
Dockerfile.arch
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
FROM archlinux:latest
# Install all the necessary packages
RUN pacman -Syu --noconfirm \
curl \
git \
inetutils \
nodejs \
npm \
python-pynvim \
sudo \
tmux \
wget \
zsh && \
pacman -Scc --noconfirm
# Download Neovim AppImage instead of building it manually,
# since it creates smaller Docker layers due to all the build dependencies
RUN wget --quiet https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage --output-document nvim && \
chmod a+x nvim && \
mv nvim /usr/bin/
# Create an user and add it to sudoers
RUN useradd -m -s /bin/zsh testuser && \
usermod -aG wheel testuser && \
echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers
# Copy local dotfiles to the image
COPY --chown=testuser:testuser . /home/testuser/.dotfiles
# Switch to testuser
USER testuser
# Automatically extract and run the AppImage when it's executed
ENV APPIMAGE_EXTRACT_AND_RUN 1
# Change working directory to .dotfiles
WORKDIR /home/testuser/.dotfiles
SHELL ["/bin/zsh", "-c"]
# Run the dotfiles installation script
RUN ./install
# Make sure to set the correct TERM
# You can override this when starting the container like this:
# `docker run -it <container> env TERM=tmux-256color /bin/zsh`
ENV TERM xterm-256color
CMD ["/bin/zsh"]