moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
8.27k stars 1.17k forks source link

The configuration of buildkit. toml does not take effect #4371

Open gdzzit opened 1 year ago

gdzzit commented 1 year ago
[root@localhost docker-builds]# docker exec -it buildx_buildkit_mybuilder0 cat /etc/buildkit/buildkitd.toml
debug = true

[log]
  format = "text"

[registry]

  [registry."192.168.18.145"]
    http = true
    insecure = true
    mirrors = ["192.168.18.145"]

[root@localhost docker-builds]# cat /etc/docker/daemon.json
{
    "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn","https://hub-mirror.c.163.com","http://192.168.18.145","https://reg-mirror.qiniu.com","https://registry.docker-cn.com"],
    "graph": "/home/softs/docker",
    "experimental": true,
    "insecure-registries":["192.168.18.145","61.144.61.156:50880","61.144.61.156:50881"]
}

logs

time="2023-10-24T09:21:19Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/Solve returned error: rpc error: code = DeadlineExceeded desc = 192.168.18.145/library/alpine-openjdk:8: failed to do request: Head \"https://192.168.18.145/v2/library/alpine-openjdk/manifests/8\": dial tcp 192.168.18.145:443: i/o timeout"
DeadlineExceeded: 192.168.18.145/library/alpine-openjdk:8: failed to do request: Head "https://192.168.18.145/v2/library/alpine-openjdk/manifests/8": dial tcp 192.168.18.145:443: i/o timeout
1 v0.12.3 buildkitd
github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb.toDispatchState.func3.1
    /src/frontend/dockerfile/dockerfile2llb/convert.go:413
golang.org/x/sync/errgroup.(*Group).Go.func1
    /src/vendor/golang.org/x/sync/errgroup/errgroup.go:75
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598

1 v0.12.3 buildkitd
main.unaryInterceptor.func1
    /src/cmd/buildkitd/main.go:607
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/moby/buildkit/frontend/gateway/pb._LLBBridge_Solve_Handler
    /src/frontend/gateway/pb/gateway.pb.go:3110
google.golang.org/grpc.(*Server).processUnaryRPC
    /src/vendor/google.golang.org/grpc/server.go:1336
google.golang.org/grpc.(*Server).handleStream
    /src/vendor/google.golang.org/grpc/server.go:1704
google.golang.org/grpc.(*Server).serveStreams.func1.2
    /src/vendor/google.golang.org/grpc/server.go:965
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598

time="2023-10-24T09:21:19Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = DeadlineExceeded desc = DeadlineExceeded: DeadlineExceeded: 192.168.18.145/library/alpine-openjdk:8: failed to do request: Head \"https://192.168.18.145/v2/library/alpine-openjdk/manifests/8\": dial tcp 192.168.18.145:443: i/o timeout"
DeadlineExceeded: DeadlineExceeded: DeadlineExceeded: 192.168.18.145/library/alpine-openjdk:8: failed to do request: Head "https://192.168.18.145/v2/library/alpine-openjdk/manifests/8": dial tcp 192.168.18.145:443: i/o timeout
1 v0.12.3 buildkitd
github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb.toDispatchState.func3.1
    /src/frontend/dockerfile/dockerfile2llb/convert.go:413
golang.org/x/sync/errgroup.(*Group).Go.func1
    /src/vendor/golang.org/x/sync/errgroup/errgroup.go:75
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598

225628 v0.10.5 /usr/local/lib/docker/cli-plugins/docker-buildx buildx build --platform linux/arm64,linux/amd64 -t 192.168.18.145/henan/gx-auth:1.0.0-RELEASE . --push
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryClient.func1.1.1
    github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:72
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.UnaryClientInterceptor.func1
    go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.29.0/interceptor.go:99
github.com/moby/buildkit/client.filterInterceptor.func1
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/client/client.go:294
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryClient.func1.1.1
    github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:72
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryClient.func1
    github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:81
google.golang.org/grpc.(*ClientConn).Invoke
    google.golang.org/grpc@v1.50.1/call.go:35
github.com/moby/buildkit/frontend/gateway/pb.(*lLBBridgeClient).Solve
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/frontend/gateway/pb/gateway.pb.go:2841
github.com/moby/buildkit/client.(*gatewayClientForBuild).Solve
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/client/build.go:89
github.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Solve
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/frontend/gateway/grpcclient/client.go:411
github.com/docker/buildx/build.BuildWithResultHandler.func4.1.2
    github.com/docker/buildx/build/build.go:1055
github.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Run
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/frontend/gateway/grpcclient/client.go:214
github.com/moby/buildkit/client.(*Client).Build.func2
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/client/build.go:59
github.com/moby/buildkit/client.(*Client).solve.func3
    github.com/moby/buildkit@v0.11.7-0.20230519102302-348e79dfed17/client/solve.go:283
golang.org/x/sync/errgroup.(*Group).Go.func1
    golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75
runtime.goexit
    runtime/asm_amd64.s:1594

1 v0.12.3 buildkitd
github.com/moby/buildkit/frontend/gateway.(*llbBridgeForwarder).Return
    /src/frontend/gateway/gateway.go:917
github.com/moby/buildkit/control/gateway.(*GatewayForwarder).Return
    /src/control/gateway/gateway.go:135
github.com/moby/buildkit/frontend/gateway/pb._LLBBridge_Return_Handler.func1
    /src/frontend/gateway/pb/gateway.pb.go:3216
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.UnaryServerInterceptor.func1
    /src/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go:342
main.unaryInterceptor.func1
    /src/cmd/buildkitd/main.go:603
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/moby/buildkit/frontend/gateway/pb._LLBBridge_Return_Handler
    /src/frontend/gateway/pb/gateway.pb.go:3218
google.golang.org/grpc.(*Server).processUnaryRPC
    /src/vendor/google.golang.org/grpc/server.go:1336
google.golang.org/grpc.(*Server).handleStream
    /src/vendor/google.golang.org/grpc/server.go:1704
google.golang.org/grpc.(*Server).serveStreams.func1.2
    /src/vendor/google.golang.org/grpc/server.go:965
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598

1 v0.12.3 buildkitd
main.unaryInterceptor.func1
    /src/cmd/buildkitd/main.go:607
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
    /src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/moby/buildkit/api/services/control._Control_Solve_Handler
    /src/api/services/control/control.pb.go:2440
google.golang.org/grpc.(*Server).processUnaryRPC
    /src/vendor/google.golang.org/grpc/server.go:1336
google.golang.org/grpc.(*Server).handleStream
    /src/vendor/google.golang.org/grpc/server.go:1704
google.golang.org/grpc.(*Server).serveStreams.func1.2
    /src/vendor/google.golang.org/grpc/server.go:965
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598

time="2023-10-24T09:21:19Z" level=debug msg="session finished: <nil>" spanID=14a249fcef45e60f traceID=0a664893c3d1d94326c632c53a6b850a
tonistiigi commented 1 year ago

If your intention is to set a mirror for Docker Hub, like in the Docker config, then you should configure [registry."docker.io"].