Code Monkey home page Code Monkey logo

docker-cache's Introduction

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/[email protected]
      with:
        key: docker-${{ runner.os }}-${{ hashFiles(paths) }}
  • Change the key to some fast function of your Docker image versions, for example, docker-${{ runner.os }}-${{ hashFiles('docker-compose.yaml') }}, if docker-compose.yaml specifies the Docker images you pull. Refer to the official GitHub cache action for guidance on creating a cache key.

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

  • Tested on ubuntu-22.04 and windows-2022
  • Probably works on ubuntu-18.04 and ubuntu-20.04
  • May work on future versions of Linux and Windows

Permissions

No permissions are required.

Changelog

Please refer to CHANGELOG.md.

docker-cache's People

Contributors

renovate-bot avatar kurt-von-laven avatar dependabot[bot] avatar mwarres avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.