Skip to content

Commit

Permalink
feat: maximize Docker cache hits of slow Ansible install
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnett committed Nov 15, 2024
1 parent 4f068a4 commit 18a5bba
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 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 Down

0 comments on commit 18a5bba

Please sign in to comment.