Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile optimizations #34

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ ENTRYPOINT [ "/usr/bin/bash", "--login" ]

FROM arch-base AS install

# Install pipx, Ansible, and the packages Ansible will install so this step will
# be cached and not re-run every single docker build. Ansible is super slow to
# install for some reason, and there's no need to excessively download packages
# from the Manjaro repo every build...
COPY manjaro_packages .
# Install pipx and Ansible so this step will be cached and not re-run every
# single docker build. Ansible is super slow to install for some reason...
RUN <<-EOF
export USE_EMOJI=0
sudo pacman -S --needed --noconfirm python-pipx
sudo pacman -S --needed --noconfirm - < manjaro_packages
pipx install --include-deps ansible
EOF

# Install the packages Ansible will want to install later. There's no need to
# excessively download packages from the Manjaro repo every build...
COPY manjaro_packages .
RUN sudo pacman -S --needed --noconfirm - < manjaro_packages

FROM install AS copy

# Copy repo to its destination
Expand All @@ -46,6 +47,12 @@ RUN <<-EOF
USE_EMOJI=0 ./setup.sh
EOF

# Run Zsh so Zinit can get set up
RUN <<-EOF
zsh -i -c -- '@zinit-scheduler burst'
nvim --headless "+Lazy! restore" +qa
EOF

# Now that zsh is (or should be) installed, we can make the entrypoint an
# interactive zsh shell
ENTRYPOINT [ "/usr/bin/zsh", "--login" ]
Loading