Skip to content

Cache the pulled Docker image with GHA? #23

Closed
@firasm

Description

@firasm

First of all, thanks for creating these examples, they've been a Godsend for me! Much appreciated.

This may be beyond the scope of this project, but is there a way to cache the pulled docker images within a GitHub Action?

I am trying to cut down on the run-time of my github action, and everything is very fast, except the initial step of pulling the docker image - which takes ~55% of the total time. Ideally the first time it would take the full time, and then subsequently, it would use a cached Docker image.

Screen Shot 2022-02-19 at 10 18 03 PM

I have been trying to read up about this, and it sounds like there is some new functionality added that makes this possible, but my attempts to make it worked haven't yielded much fruit.

Some references

Adding this to my GHA should work, but I don't think I've got the placement quite right:

      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-single-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-single-buildx

Let me know if I can provide any more information

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions