LukeMathWalker / cargo-chef

A cargo-subcommand to speed up Rust Docker builds using Docker layer caching.
Apache License 2.0
1.72k stars 113 forks source link

[Question] How to use Cargo Chef - Docker images and Github Actions #229

Closed ajosecueto closed 1 year ago

ajosecueto commented 1 year ago

I'm using github actions to build my docker images and deploy it to my servers, but the docker is build in every action, how to cache in github actions. Someone could provide me an example.

Thanks

MPThLee commented 1 year ago

You should use docker cache. With actions/cache, You can do a command line with: https://docs.docker.com/build/cache/backends/ Also with Docker Buildx Github Action for cleaner management: https://docs.docker.com/build/ci/github-actions/cache/ (Note: Some of options still requires actions/cache)

LukeMathWalker commented 1 year ago

@MPThLee pointed you in the right direction—I'll close this now, but feel free to re-open if you have other doubts.