Skip to content

feat(ci): accelerate Docker builds with BuildKit cache mounts#877

Open
Copilot wants to merge 3 commits intomainfrom
copilot/accelerate-builds-with-caching
Open

feat(ci): accelerate Docker builds with BuildKit cache mounts#877
Copilot wants to merge 3 commits intomainfrom
copilot/accelerate-builds-with-caching

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 28, 2025

Docker builds in CI are slow due to repeated downloads of pip packages and compilation of Go/Rust tools from source. This adds BuildKit cache mounts to persist these artifacts across builds.

Changes

Dockerfiles - Added RUN --mount=type=cache for dependency caches:

  • /root/.cache/pip - Python packages
  • /root/.cache/pipx - Pipx virtual environments
  • /root/.cache/go-build + /root/go/pkg/mod - Go build artifacts and modules
  • /root/.cargo/registry + /root/.cargo/git - Rust dependencies

Applied to all platform Dockerfiles: alpine, arch, debian, kali, osx, ubuntu.

CI Workflows - Enabled BuildKit:

  • Set DOCKER_BUILDKIT=1 in docker.yml, publish.yml, cloudbuild.yaml

Example

# Before
RUN pipx install . && secator install addons worker

# After - cache persists across builds, not included in final image
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=cache,target=/root/.cache/pipx \
    pipx install . && secator install addons worker

Expected 40-60% reduction in build time on subsequent runs with no image size increase.

Original prompt

This section details on the original issue you should resolve

<issue_title>feat(ci): accelerate builds with caching</issue_title>
<issue_description>Accelerate builds by caching Secator pip dependencies and also caching Secator tools bin directories (~/.local/pipx, ~/go/, ~/.cargo) within the Docker build</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 28, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: ocervell <9629314+ocervell@users.noreply.github.com>
Copilot AI changed the title [WIP] Add caching for Secator pip dependencies and tools feat(ci): accelerate Docker builds with BuildKit cache mounts Dec 28, 2025
Copilot AI requested a review from ocervell December 28, 2025 10:10
@ocervell ocervell marked this pull request as ready for review December 28, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ci): accelerate builds with caching

2 participants