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

Add caching to docker build #42

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ jobs:
type=pep440,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(env.RELEASE_VERSION, '-') }}

# https://github.com/WarpBuilds/rust-cache
- name: Run WarpBuilds/rust-cache
uses: WarpBuilds/rust-cache@v2
with:
cache-on-failure: true

# https://github.com/Mozilla-Actions/sccache-action
- name: Setup sccache-action
uses: mozilla-actions/[email protected]

- name: Set env vars
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ RUN cargo chef prepare

# Build application
FROM chef AS builder
COPY --from=planner /app/recipe.json .

# Install system dependencies
RUN apt-get update && \
apt-get install -y openssl libclang-dev libssl3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*


COPY --from=planner /app/recipe.json .
RUN cargo chef cook --release
COPY . .
RUN cargo build --release

FROM chef AS final
FROM debian:bullseye-slim AS final
COPY --from=builder /app/target/release/rollup-boost /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/rollup-boost"]
Loading