acr icon indicating copy to clipboard operation
acr copied to clipboard

Tasks: Support for layer caches

Open michiels opened this issue 5 years ago • 18 comments

Is this a BUG REPORT or FEATURE REQUEST?:

Feature request

What happened?:

I’m building an image via quick task. It appears that steps in my Dockerfile that create intermediate layers are not re-used on subsequent builds of the same Dockerfile.

What did you expect to happen?:

I would like to have ACR Tasks use layer caches from previous build to skip build time of those layers.

How do you reproduce it (as minimally and precisely as possible)?:

Build an image with a Dockerfile.

Build the same Dockerfile again: steps that should be cached are run again unnecessary.

michiels avatar Mar 18 '19 21:03 michiels

@michiels We are experimenting the layer cache with buildx. Check out the PR #230 is you are interested.

northtyphoon avatar May 28 '19 01:05 northtyphoon

@michiels were you able to go through the buildx sample we posted. Also are planning to first class this experience later during the year.

sajayantony avatar May 31 '19 05:05 sajayantony

Maybe not exactly the same feature request as I'm not using the az acr run, but I've the following setup:

- az acr build --registry "${MY_ACR}" --target prod --image "demoapp:build.${CI_PIPELINE_ID}" .
- az acr build --registry "${MY_ACR}" --target test --image "${APP}:test.${CI_PIPELINE_ID}" .

With this setup ACR is currently not able to use the previous build demoapp:build.${CI_PIPELINE_ID} as cache for building the test image.

I'd be awesome if I could directly use the --cache-from feature in the ´az acr build´ command like:

- az acr build --registry "${MY_ACR}" --target prod --image "demoapp:build.${CI_PIPELINE_ID}" .
- az acr build --registry "${MY_ACR}" --target test --cache-from "demoapp:build.${CI_PIPELINE_ID}" --image "${APP}:test.${CI_PIPELINE_ID}" .

Are there any plans to support caching for az acr build?

subesokun avatar Jun 04 '19 15:06 subesokun

@subesokun for now I'd recommend just using az acr run - it can do what you want and it will always have newer features immediately. az acr build has to receive API and CLI support so it will naturally lag behind. We'll talk more about first-classing support.

ehotinger avatar Jun 06 '19 22:06 ehotinger

hi @northtyphoon and @sajayantony. Thanks for the replies! I haven't gotten back to this project for the past few weeks due to the restrictions and used CircleCI?Docker Hub so far for image builds. However, with those recent changes you made let me check if it makes sense again to return to ACR for that reason :)

michiels avatar Jun 07 '19 13:06 michiels

Any update on this? My multi-stage .net framework (SDK->Runtime) builds take 50m.

Pool: Azure Pipelines
Image: windows-latest
Agent: Azure Pipelines 6
Started: Today at 7:35 PM
Duration: 50m 28s

aidapsibr avatar Jul 14 '20 03:07 aidapsibr

That feature was requested 2 years ago. Any updates on it?

akazakou-incomm avatar Nov 05 '21 11:11 akazakou-incomm

Hi folks, noticed this was marked as completed then re-opened and put in the backlog.

I'm curious if you have any indication how difficult it would be to implement this feature and whether or not it's likely to be completed this year?

TheGuyWhoAsksForUpdates avatar May 27 '22 08:05 TheGuyWhoAsksForUpdates

Hi team, any updates on this capability to cache layers within a build? Would dedicated agents for task execution help with this?

haithamshahin333 avatar Sep 01 '22 15:09 haithamshahin333

I am also interested in this feature. Does anyone have any updates?

AlonsoM45 avatar Nov 28 '22 21:11 AlonsoM45

It would be great if you implement this feature. It will accelerate CD/CI pipeline if az acr could support layer cache.

AlirezaNaziri avatar Dec 09 '22 12:12 AlirezaNaziri

Bumping interest for layer caching support for acr build tasks.

SebastianCarreiraSC avatar Apr 13 '23 11:04 SebastianCarreiraSC

Bumping interest for this feature.

dtu-ruth avatar Nov 08 '23 06:11 dtu-ruth

Bumping interest for this feature.

amjanoni avatar Jan 30 '24 12:01 amjanoni

bumping dor interest too 4 year and still open "yeaahh"

quentled avatar Jan 31 '24 11:01 quentled

Bumping interest for this feature.

spyrosmouchlianitis avatar Feb 02 '24 13:02 spyrosmouchlianitis

Bumping for interest - seems like an extremely useful feature and one that a modern container building tool would support

peter-resnick avatar Apr 15 '24 19:04 peter-resnick

Bumping for interest. As others have mentioned would be a great addition

rhwork avatar Apr 17 '24 07:04 rhwork