DockerBuild information if the build was from the cached #3116
Replies: 1 comment 1 reply
-
Docker has a concept of layer caching: If a layer of a Docker image has not changed it won't be rebuild. See for example this article for an introduction to Docker caching. Are you using a multi-stage docker file or are you calling first MsBuild to compile and then Docker to build then image? What Visual Studio probably does in this case is hooking into MsBuild pipeline, which is on a different level than Cake (which is a build automation tool). You can still use your Cake build to run MsBuild, which contains your custom targets which implement the same logic as Visual Studio does. But in this case MsBuild will run Docker and not Cake directly. Otherwise the Cake.Docker extension is just a wrapper around Docker CLI. If you know the the Docker CLI calls you want to run you can definitely do this with the Cake.Docker extension. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to optimize my build/deploy pipelines and pushing only new docker images to a registry with code changes.
When there are no code changes for some project, it should keep the previous image.
Is it possible to find out if a docker build is a from the cache?
Or other ways to find out if there are code changes for a project?
For example Visual Studio knows when there are code changes and will only build when it is changed.
I like to use the same mechanism in cake frosting.
Beta Was this translation helpful? Give feedback.
All reactions