Docker BuildKit with --mount=type=cache and mounted yarn cache seemingly empty always? #1283
-
|
I am trying to speed up my yarn install types when a package dependency changes. I've tried to repro the issue down to its core. package.json (random packages, sample) Dockerfile Now I run Output of first pass Next I removed the Output of second pass As you can see, the second pass look pretty identical to the first. The result of I am on macOS. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
|
I even tried adding explicit ID, sharing, and mode. Here is an output from a run: Output of A few questions:
|
Beta Was this translation helpful? Give feedback.
-
|
It seems like the cache was empty because the key wasn't properly evaluating |
Beta Was this translation helpful? Give feedback.
-
|
I encountered the same problem, and adding a # syntax = docker/dockerfile:1.4to the top of my |
Beta Was this translation helpful? Give feedback.
-
|
A follow-up question here: If we use the S3 cache backend (which is awesome, btw!!!!!), do these buildx cache-mounts get cached and uploaded to S3 as well? (see code below for an example of the build command) The reason I ask is because we are stuck using BitBucket pipelines...and there are stupid limits and requirements there, including having to use Example docker buildx command: |
Beta Was this translation helpful? Give feedback.
It seems like the cache was empty because the key wasn't properly evaluating
$YARN_CACHE_FOLDER. Instead best to just hardcode the paths and not from an ENV variable.