testcontainers / testcontainers/testcontainers-java
Since Docker 20.10.6: Error starting userland proxy: listen tcp6
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 9
Descrizione
With Docker 20.10.6 docker is failing when ipv6 is disabled.
There seems to be a workaround by explicitly specifying the network interface. For example:
$ docker run --rm -d -p 0.0.0.0:8080:80 nginx:latest
Is there a possibility to specify the network inteface using the GenericContainer? I cannot find anything in the API. Any workaround is appreciated, since all docker tests are failing due to this issue and it is no possible to enable ipv6 on our CI environment.
See also: docker ipv6 disabled issue
The following is the actual error that occurs during running a testcontainer;
``
com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"driver failed programming external connectivity on endpoint testcontainers-ryuk-dad37a3e-2c74-4bff-bd37-0f0051d3b934 (1ef25a1f64f846100fdc06fab4ff91322026ddf8bc70a312049358348d4a94fb): Error starting userland proxy: listen tcp6 [::]:49212: socket: address family not supported by protocol"}
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:102)
at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:31)
at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:13)
at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at org.testcontainers.shaded.com.github.dockerjava.core.command.StartContainerCmdImpl.exec(StartContainerCmdImpl.java:43)
at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:110)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:205)
at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)
at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:1029)
at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29)
``
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando GenericContainer.start() e ResourceReaper.start() dallo stack trace, quindi esamina come vengono passati a Docker i binding delle porte dei container. Riproduci il problema con IPv6 disabilitato e confrontalo con il workaround documentato 0.0.0.0. Il lavoro è completato quando i test Docker possono avviarsi correttamente in quell’ambiente CI con un’opzione esplicita per l’interfaccia di rete.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, java
- Ambito
- devops, testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100