From 4e7a113a7d1f4977393da8d3f9f8caba4be5d360 Mon Sep 17 00:00:00 2001 From: Steven Honson Date: Sun, 8 Sep 2024 20:39:52 +1000 Subject: [PATCH] Try another approach --- .github/workflows/container.yml | 17 ++--------------- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 1758055e..b883266e 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -17,25 +17,11 @@ jobs: matrix: platform: [linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7] steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Declare platform run: | platform=${{ matrix.platform }} echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV - - name: Create pip cache directory - run: mkdir -p /tmp/pip-cache - - - name: Cache pip artifacts - uses: actions/cache@v4 - with: - path: /tmp/pip-cache - key: pip-cache-${{ env.PLATFORM }}-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - pip-cache-${{ env.PLATFORM }}- - - name: Setup QEMU uses: docker/setup-qemu-action@v3 @@ -60,9 +46,10 @@ jobs: uses: docker/build-push-action@v6 with: platforms: ${{ matrix.platform }} - build-contexts: pip-cache=/tmp/pip-cache labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' && 'true' || 'false' }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM }} + cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM }},mode=max - name: Export digest if: ${{ github.event_name != 'pull_request' }} diff --git a/Dockerfile b/Dockerfile index dc0ed2d2..e11c9e20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ COPY auto_rx/requirements.txt \ /root/radiosonde_auto_rx/auto_rx/requirements.txt # Install Python packages. -RUN --mount=type=cache,target=/root/.cache/pip,from=pip-cache pip3 install \ +RUN pip3 install \ --user --break-system-packages --no-warn-script-location --ignore-installed \ -r /root/radiosonde_auto_rx/auto_rx/requirements.txt