Skip to content

The minimal example of the Docker multi-stage build with BuildKit caching for Rust

Notifications You must be signed in to change notification settings

k-khr/docker-buildkit-cargo-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-buildkit-cargo-example

The minimal example of the Docker multi-stage build with BuildKit caching for Rust

Usage

  1. first build
$ DOCKER_BUILDKIT=1 docker build .
[+] Building 51.7s (17/17) FINISHED
...
  1. modify src/main.rs like
7c7
<     println!("{}", y);
---
>     // println!("{}", y);
  1. second build
$ DOCKER_BUILDKIT=1 docker build .
[+] Building 5.5s (17/17) FINISHED
...

The build time was reduced by 89%: 51.7s -> 5.5s

About

The minimal example of the Docker multi-stage build with BuildKit caching for Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published