Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Error when connecting to docker-rootless socket via tcp

Aperta
#57 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
docker, gitlab, php

Direzione di ricerca

Riproduci le due configurazioni in .gitlab-ci.yml, iniziando dalla configurazione TCP e dallo stack trace in vendor/php-http/socket-client/src/Client.php:85. Confrontala con la configurazione funzionante tramite Unix socket e /etc/gitlab-runner/config.toml; il lavoro è completato quando dind-rootless funziona tramite TCP senza l’errore segnalato Cannot read the response.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When running testcontainers in GitLab CI with dind-rootless service, it does not work when connecting via tcp.

It works with dind (rootful):

.gitlab-ci.yml:

test:
  stage: test
  image: php:8.3-cli
  services:
    - docker:29-dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""

Doesn't work with dind-rootless (Exact same setup works with testcontainers-dotnet)

.gitlab-ci.yml:

test:
  stage: test
  image: php:8.3-cli
  services:
    - docker:29-dind-rootless
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""
    TESTCONTAINERS_RYUK_DISABLED: true

This is the error:
1) Exception in third-party event subscriber: Cannot read the response
#0 /builds/group/project/vendor/php-http/socket-client/src/Client.php(85): Http\Client\Socket\Client->readResponse()
#1 /builds/group/project/vendor/php-http/client-common/src/HttpClientDecorator.php(28): Http\Client\Socket\Client->sendRequest()

It works when binding the dind docker socket though:

.gitlab-ci.yml:

test-php:
  stage: test
  image: php:8.3-cli
  services:
    - name: docker:29-dind-rootless
  variables:
    DOCKER_HOST: "unix:///runner/services/docker/docker.sock"
    TESTCONTAINERS_RYUK_DISABLED: true
    TESTCONTAINERS_HOST_OVERRIDE: docker

In /etc/gitlab-runner/config.toml
volumes = ["/runner/services/docker", "/cache"]

Lingua principale
PHP
Stelle
214
Fork
34
Merge medio
1h 19m
PR unite (30g)
2

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testcontainers/testcontainers-php

Tutte le issue di testcontainers/testcontainers-php

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.