Skip to content

Commit

Permalink
Merge pull request #42 from flashbots/release-cache
Browse files Browse the repository at this point in the history
Add caching to docker build
  • Loading branch information
avalonche authored Dec 9, 2024
2 parents 82a7392 + e3a9f59 commit 424e4a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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"]

0 comments on commit 424e4a3

Please sign in to comment.