Skip to content

Commit

Permalink
chore: better caching of docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Dec 24, 2024
1 parent 7b923c5 commit 572385e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
script: |
const builtImages = JSON.parse(process.env.BUILT_IMAGES);
const tags = builtImages.app.images.join(',');
const digest = builtImages.app.digests[0];
const digest = builtImages.app.digests[0].includes('@') ? builtImages.app.digests[0].split('@')[1] : '';
core.setOutput('tags', tags);
core.setOutput('digest', digest);
env:
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM python:3.12-slim-bullseye AS builder

# hadolint ignore=DL3008
RUN set -eux; export DEBIAN_FRONTEND=noninteractive; \
RUN --mount=type=cache,target=/var/cache/apt \
set -eux; export DEBIAN_FRONTEND=noninteractive; \
apt-get update; \
apt-get install -y --no-install-recommends build-essential gcc

WORKDIR /build

COPY requirements.txt requirements.txt

# hadolint ignore=DL3042
RUN --mount=type=cache,target=~/.cache/pip \
pip install --user -r requirements.txt
Expand Down

0 comments on commit 572385e

Please sign in to comment.