moby / moby/buildkit

Use "--driver docker-container" network was timeout or reset peer when connect github or raw.github

Open
#5,299 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/needs-more-info
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

ISSUE

  1. Use "--driver docker-container" network was timeout or reset peer when connect github.com or raw.githubusercontent.com
  2. Use "--driver docker" network was OK when connect github.com or raw.githubusercontent.com

CODE


script:
    - docker run --rm --privileged tonistiigi/binfmt --install all
    - docker context create ctx-$ARCH-$CI_PROJECT_ID
    - docker buildx create --name mybuilders --driver docker-container --use ctx-$ARCH-$CI_PROJECT_ID
    - |
      docker buildx build \
        --load \
        --builder mybuilders \
        --build-arg FLUTTER_VERSION=$FLUTTER_VERSION \
        --platform linux/${ARCH} \
        --cache-from type=registry,ref=${TAG_NAME} \
        --cache-to type=inline,mode=max \
        --tag ${TAG_NAME} \
        --network host \
        --file Dockerfile \
        --push .


ENVIROMENT

$ docker info
Client:
 Version:    27.2.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.2
    Path:     /usr/local/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.2
    Path:     /usr/local/libexec/docker/cli-plugins/docker-compose
Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 27.2.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-76-generic
 Operating System: Alpine Linux v3.20 (containerized)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.58GiB
 Name: runner-81syxtawp-project-104201-concurrent-0-bo3hvyq0
 ID: c05a2[24](https://gitlab.gz.cvte.cn/tv-infrastructure/cicd/hub.image/flutter/-/jobs/963034#L24)0-b373-4bc2-920c-da8622e70000
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  1[27](https://gitlab.gz.cvte.cn/tv-infrastructure/cicd/hub.image/flutter/-/jobs/963034#L27).0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine
FROM ubuntu:24.04
....

GITLAB-RUNNER: 17.02

tonistiigi/binfmt:latest
sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55

CHECK LIST

In Container:

  • ✅ DNS

  • ✅ ping & nslookup & dig
    image2024-9-4_14-39-6

  • ❎ curl
    image

In Node:

  • ✅ DNS
  • ✅ ping & nslookup & dig
  • ✅ curl

TRY FIXING

❎ CURL -V

image

Install ca-certificates

apt-get -y update \
&& apt-get -y install ca-certificates wget \
&& mkdir -p /usr/share/ca-certificates/cacert.org \
&& wget -P /usr/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt \
&& update-ca-certificates

Refer:https://stackoverflow.com/questions/35821245/github-server-certificate-verification-failed/35824116#35824116

STILL ERROR.

❎ Custom Parameters

image

STILL ERROR.

✅ RESET "--driver" DEFAULT

image2024-9-4_17-43-20

But, "--driver docker " not support multi-platforms.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided docker buildx build commands with the docker-container and docker drivers, then compare connectivity to github.com and raw.githubusercontent.com inside the builder. Use the listed Docker, Buildx, GitLab Runner, and host environment details when testing. Done means the docker-container driver supports the reported multi-platform build without the timeout or reset-peer failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
build-system, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.