Skip to content

Cache Docker Images Whether Built or Pulled

License

Notifications You must be signed in to change notification settings

omnigres/docker-cache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-cache

GitHub Action: Try Me Docker Cache Test Workflow Status Test Coverage: 100% Copy/Paste: 0%

Automated Updates: Renovate Language: TypeScript Runtime: Node.js REPL: ts-node Test Framework: Jest Package Management: Yarn Package Management: Poetry Git Hooks: pre-commit Commit Style: Conventional Commits Releases: Semantic Versioning Code Style: Prettier Code Style: EditorConfig Editor: Visual Studio Code

Cache Docker Images Whether Built or Pulled

Cache Docker images whether built or pulled by saving them on cache misses and loading them on cache hits. Filter out Docker images that are present before the action is run, notably those pre-cached by GitHub actions; only save Docker images pulled or built in the same job after the action is run. Note that this action does not perform Docker layer caching. The official Docker build push action performs Docker layer caching for built images but does not cache pulled images.

Usage

  • Add the following step before your first use of Docker:

    - name: Cache Docker images.
      uses: ScribeMD/docker-cache@0.2.6
      with:
        key: docker-${{ runner.os }}-${{ hashFiles(...) }}

Inputs

Required

key

The explicit cache key to ferry to the official GitHub cache action. restore-keys are not supported, because partial cache restoration leads to a "snowball" effect.

Optional

read-only

default: false

If "true", disable saving cache upon cache miss.

Outputs

cache-hit

The ferried output of the official GitHub cache action. True on cache hit (even if the subsequent docker load failed) and false on cache miss. See also skipping steps based on cache-hit.

Supported Runners

Please refer to README.md of ScribeMD/rootless-docker.

Permissions

No permissions are required.

Changelog

Please refer to CHANGELOG.md.

About

Cache Docker Images Whether Built or Pulled

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.0%
  • Dockerfile 1.0%