buildkit-cli-for-kubectl
buildkit-cli-for-kubectl copied to clipboard
Build using Harbor registry cache
Hello, I am trying to figure out what's this error when using kubectl build in conjunction with Harbor registry and cache -
kubectl build --push --registry-secret regcred --cache-to=type=registry,ref=registry.uk/backend/coordinatorserver:latest --cache-from=type=registry,ref=registry.uk/backend/coordinatorserver:latest -t registry.uk/backend/coordinatorserver:test3 -f Dockerfile ./
[+] Building 4.4s (21/21) FINISHED
=> [internal] load build definition from Dockerfile 0.2s
=> => transferring dockerfile: 2.27kB 0.2s
=> [internal] load .dockerignore 0.2s
=> => transferring context: 2B 0.1s
=> [internal] load metadata for mcr.microsoft.com/dotnet/runtime:5.0-alpine 0.1s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0-alpine 0.1s
=> importing cache manifest from registry.infra.trbl.uk/backend/coordinatorserver:latest 0.6s
=> [build-env 1/6] FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine@sha256:0e0c3c5f8448815c03ddd889218391611e644acb1af5eedd60a4b7d9eefe0b0f 0.0s
=> => resolve mcr.microsoft.com/dotnet/sdk:5.0-alpine@sha256:0e0c3c5f8448815c03ddd889218391611e644acb1af5eedd60a4b7d9eefe0b0f 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 5.39kB 0.2s
=> [stage-1 1/7] FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine@sha256:4bf067dc6f280483e99ce6b669f4efc911d25e7d8b8c5c0bb5db81ff9e5ff353 0.0s
=> => resolve mcr.microsoft.com/dotnet/runtime:5.0-alpine@sha256:4bf067dc6f280483e99ce6b669f4efc911d25e7d8b8c5c0bb5db81ff9e5ff353 0.0s
=> CACHED [stage-1 2/7] WORKDIR /app 0.0s
=> CACHED [build-env 2/6] WORKDIR /build 0.0s
=> CACHED [build-env 3/6] COPY . . 0.0s
=> CACHED [build-env 4/6] RUN dotnet restore 0.0s
=> CACHED [build-env 5/6] RUN dotnet publish -c Release -o ./output -r alpine-x64 -v normal -f net5.0 0.0s
=> CACHED [build-env 6/6] RUN chmod u+x,o+x ./output/Application.dll 0.0s
=> CACHED [stage-1 3/7] COPY --from=build-env /build/harden.sh . 0.0s
=> CACHED [stage-1 4/7] RUN chmod +x harden.sh && sh harden.sh && rm harden.sh 0.0s
=> CACHED [stage-1 5/7] COPY --from=build-env --chown=app:app /build/output . 0.0s
=> CACHED [stage-1 6/7] COPY --from=build-env /build/post-install.sh . 0.0s
=> CACHED [stage-1 7/7] RUN chmod +x post-install.sh && sh post-install.sh Application.dll && rm post-install.sh 0.0s
=> exporting to image 1.0s
=> => exporting layers 0.0s
=> => exporting manifest sha256:7e827376bc8fd938824824e2a990bcdd4c74a88d5ac20c42d3364d1d95c88f6d 0.0s
=> => exporting config sha256:f660f163c5f39e615c9c8d47bd55a3151e751faa2adab58423ebd13b416a6e23 0.0s
=> => naming to registry.uk/backend/coordinatorserver:test3 0.0s
=> => pushing layers 0.6s
=> => pushing manifest for registry.uk/backend/coordinatorserver:test3@sha256:7e827376bc8fd938824824e2a990bcdd4c74a88d5ac20c42d3364d1d95c88f6d 0.4s
=> ERROR exporting cache 2.2s
=> => preparing build cache for export 0.1s
=> => writing layer sha256:4486b0038adfc9f468af58726fade658b5fb3616d04c7fc932cd675bdccdf210 0.2s
=> => writing layer sha256:4e9f2cdf438714c2c4533e28c6c41a89cc6c1b46cf77e54c488db30ca4f5b6f3 0.1s
=> => writing layer sha256:5d9c09a4a9270c9f2194c864123a5f556715aadb3c1ca71e9a2754acd5329bdc 0.2s
=> => writing layer sha256:7260e0808c3e35e413a408a9783c08aff3e8fd12bf3ec825bd4f0b4cdb090821 0.2s
=> => writing layer sha256:7d087572982f1d7e4ce594421785385f429866724a3add2c3c5285b42563b4c5 0.2s
=> => writing layer sha256:abe1e2b3e1060e8501c0df42a22a5a566934c90a56d090d8705623ea88ce9f47 0.1s
=> => writing layer sha256:d9ac61d22b4283081bb65ce2d073dba64ded878f10c9dc966222a209a8387f4d 0.2s
=> => writing layer sha256:dd725bf97525ad260d2d569ed8c66820ff6dcfbfd07d1f1e6f362346a03e3914 0.2s
=> => writing layer sha256:fd4b0c6f124644904fac1cc83236146831a2334d049f8d3074fa690f999bf339 0.1s
=> => writing config sha256:c98a35702b8a8f14ffdf0d28cc2a5819901af6ee5c88c281e246f0e127534042 0.2s
=> => writing manifest sha256:6509a7e52e216acff5ea42dec662fbb950c0288bb7afe6747047ff4935cfb841 0.6s
------
> exporting cache:
------
Error: failed to solve: rpc error: code = Unknown desc = error writing manifest blob: failed commit on ref "sha256:6509a7e52e216acff5ea42dec662fbb950c0288bb7afe6747047ff4935cfb841": unexpected status: 404 Not Found
I dont understand why it can't export the cache.
@Born2Bake I'm a maintainer of Harbor but not quite sure how buildkit works.
Could you increase the verbose level to clarify. if the error happened when it was communicating with the registry?
same issue with buildkit, using trace option,but no more informations in log.