harbor: Using buildkit exporting cache reporting status: 404 Not Found
finding : buildkit cache and image export compatibility with harbor
Work : export both output and cache layer together
https://github.com/moby/buildkit#inline-push-image-and-cache-together
buildctl --addr docker-container://buildkitd build \
--frontend dockerfile.v0 --local context=. --local dockerfile=docker/test --progress=plain \
--output type=image,name=harbor-test.mysite.com/buildkit-cache/my-operator,push=true \
--export-cache type=inline \
--import-cache type=registry,ref=harbor-test.mysite.com/buildkit-cache/my-operator
...
#15 [base 8/16] RUN --mount=type=cache,target=/root/go/pkg/mod --mount=...
#15 CACHED
#14 [base 7/16] COPY go.sum .
#14 CACHED
#23 [base 16/16] RUN --mount=type=cache,target=/root/go/pkg/mod --mount=...
#23 CACHED
#24 exporting to image
#24 exporting layers done
#24 exporting manifest sha256:4cfd02e1abeb95dd038222ac9eefa36683cbd137881ac2439c02f6a5365f340c done
#24 exporting config sha256:3a39d7f051b9c2e0d392d29a205bed9607193201fe79ad38636e000cb78b510d
#24 exporting config sha256:3a39d7f051b9c2e0d392d29a205bed9607193201fe79ad38636e000cb78b510d done
#24 pushing layers
#24 pushing layers 1.1s done
#24 pushing manifest for harbor-test.mysite.com/buildkit-cache/my-operator:latest
#24 pushing manifest for harbor-test.mysite.com/buildkit-cache/my-operator:latest 0.1s done
#24 DONE 1.3s
#25 exporting cache
#25 preparing build cache for export done
#25 DONE 0.0s
Doesn’t work : export output and cache layer separately
buildctl --addr docker-container://buildkitd build \
--frontend dockerfile.v0 --local context=. --local dockerfile=docker/test --progress=plain \
--export-cache type=registry,ref=harbor-test.mysite.com/buildkit-cache/my-operator \
--import-cache type=registry,ref=harbor-test.mysite.com/buildkit-cache/my-operator
24 exporting cache
#24 preparing build cache for export
#24 preparing build cache for export 15.8s done
...
#24 writing config sha256:19ac525ecabdc96ffbe803eef74acf809b082c37af057873137388121f491dcd
#24 writing config sha256:19ac525ecabdc96ffbe803eef74acf809b082c37af057873137388121f491dcd 0.1s done
#24 writing manifest sha256:878798161048504bee835f947ff94fdd915232bd8b277aacd6a511e5e77bd475
#24 writing manifest sha256:878798161048504bee835f947ff94fdd915232bd8b277aacd6a511e5e77bd475 0.1s done
#24 ERROR: error writing manifest blob: failed commit on ref "sha256:878798161048504bee835f947ff94fdd915232bd8b277aacd6a511e5e77bd475": unexpected status: 404 Not Found
------
> exporting cache:
------
error: failed to solve: rpc error: code = Unknown desc = error writing manifest blob: failed commit on ref "sha256:878798161048504bee835f947ff94fdd915232bd8b277aacd6a511e5e77bd475": unexpected status: 404 Not Found
Versions: Please specify the versions of following systems.
harbor version: 2.2.1 docker engine version: 20.10.5 docker-compose version 1.18.0, build 8dd22a9
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 35
- Comments: 43
Commits related to this issue
- Fix buildkit cache export to harbor. Thx to @XciD This fixes goharbor/harbor#14774 — committed to corpusops/harbor by kiorky a year ago
- Fix buildkit cache export to harbor. Thx to @XciD This fixes #14774 — committed to corpusops/harbor by kiorky a year ago
- Fix buildkit cache export to harbor. Thx to @XciD This fixes goharbor/harbor#14774 Signed-off-by: Mathieu Le Marec - Pasquet <kiorky@cryptelium.net> — committed to corpusops/harbor by kiorky a year ago
- Fix buildkit cache export to harbor. Thx to @XciD This fixes goharbor/harbor#14774 Signed-off-by: Mathieu Le Marec - Pasquet <kiorky@cryptelium.net> — committed to corpusops/harbor by kiorky a year ago
- Fix buildkit cache export to harbor. Thx to @XciD This fixes goharbor/harbor#14774 Signed-off-by: Mathieu Le Marec - Pasquet <kiorky@cryptelium.net> — committed to corpusops/harbor by kiorky a year ago
- tmp: cache to dockerhub instead harbor is buggy, can't take cache: https://github.com/goharbor/harbor/issues/14774 — committed to Gehock/jupyter-aalto-singleuser by Gehock a year ago
- Use a registry to cache builds Creates a buildx container-builder driver and sends the build cache to and receives from GitHub. Harbor is buggy, can't receive cache currently: https://github.com/goha... — committed to Gehock/jupyter-aalto-singleuser by Gehock a year ago
- Use a registry to cache builds Creates a buildx docker-container driver [1] to send the build cache to and receive from GitHub. Harbor cannot currently be used to store the cache because of a bug [2]... — committed to Gehock/jupyter-aalto-singleuser by Gehock a year ago
- Use a registry to cache builds Creates a buildx docker-container driver [1] to send the build cache to and receive from GitHub. Harbor cannot currently be used to store the cache because of a bug [2]... — committed to Gehock/jupyter-aalto-singleuser by Gehock a year ago
- Use a registry to cache builds Creates a buildx docker-container driver [1] to send the build cache to and receive from GitHub. Harbor cannot currently be used to store the cache because of a bug [2]... — committed to Gehock/jupyter-aalto-singleuser by Gehock a year ago
- Use a registry to cache builds Creates a buildx docker-container driver [1] to send the build cache to and receive from GitHub. Harbor cannot currently be used to store the cache because of a bug [2]... — committed to AaltoSciComp/jupyter-aalto-singleuser by Gehock a year ago
- ci(@daotl/desktop,@daotl/web): fix container target "cache-to" option See: https://github.com/goharbor/harbor/issues/14774#issuecomment-1821167259 — committed to daotl/web-monorepo-starter by NexZhu 7 months ago
This is still very relevant. Would there be any news about this?
If any one want to fix:
Then you can rebuild the images with
make compile build
I don’t know the side effect on garbage collection tho.
Hi, we would be interested by news about this as well, this is crucial for Production grade build capability with Harbor and buildkit. Alternately, has anyone used a separate generic repo exclusively for caching as a workaround? (when not using Github actions)
Any updates here?
Any news on this one? It’s still an issue on v2.5.
+1 Same issue to me.
Here is what I found on my gateway:
harbor version: 2.3.2 docker engine version: 20.10.8+azure buildkit: github.com/moby/buildkit v0.9.0
@prosnekov as mentioned in https://github.com/goharbor/harbor/pull/18105, you can provide
image-manifest=true
:--export-cache type=registry,mode=max,image-manifest=true,ref=$CACHE_IMAGE
However, the option is only available for buildkit:master (which afaik is not stable), and not yet for buildkit:latest.
Having the same issue here. Is there any update on this?
Uping this one.
Any update on this? How could I help ?
still an issue for harbor 2.6.1
Running into this issue as well, is this fixed in a recent version, or is it still in the backlog?
we are still there. i’m wondering if it’s not less work to fix it than do some triage every week on the issue since 2 years …
@XciD i also took the time that artifacts are well cleaned up upon GC, and seems everything is OK.
I did some investigation around this issue, if you use
--cache-to "type=registry,mode=max,ref=registry....
it will end up trying to uploaf manufest of typeapplication/vnd.buildkit.cacheconfig.v0
which is not supported by all registry implementation, I think harbor does not support it?I found this in logs of buildx docker instance:
can someone with knowledge confirm the support for
application/vnd.buildkit.cacheconfig.v0
media type?inline cache is probably good workaround: https://github.com/moby/buildkit#inline-push-image-and-cache-together