Skip to content

Commit

Permalink
perf: using cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Jul 17, 2024
1 parent 89fda33 commit 1ec678a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jobs:
run: echo "REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV

- name: Build and push multi-arch image
run: |
DOCKER_BUILDKIT=1 docker buildx build \
--platform linux/amd64,linux/arm64 \
-f Dockerfile-base \
-t jumpserver/${{ env.REPO }}-base:${{ env.IMAGE_TAG }} \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--push .
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile-base
tags: jumpserver/${{ env.REPO }}-base:${{ env.IMAGE_TAG }}
cache-from: type=registry
cache-to: type=inline

- name: Update Dockerfile
run: |
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN set -ex \

WORKDIR /data


COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=yarn-cache \
yarn install

0 comments on commit 1ec678a

Please sign in to comment.