Open DmPanov opened 6 years ago
Also affected by this issue
This is only happen for Docker-Compose? How do you create the container?
@kiview yes, only for Docker-Compose
class TeamCityInDocker(id: String) : DockerComposeContainer<TeamCityInDocker>(id, Paths.get(TeamCityInDocker::class.java.classLoader.getResource("docker-compose.yml").toURI()).toFile()) {
init {
val ambassadorContainer = DockerComposeContainer::class.java
.declaredFields.first { it.type == SocatContainer::class.java }
.apply { isAccessible = true }
.get(this) as SocatContainer
ambassadorContainer.withStartupTimeout(Duration.ofMinutes(5))
withLocalCompose(true) // or false
}
version: "3"
services:
teamcity-server:
image: teamcity-server:2018.1.1
ports:
- "8111:8111"
teamcity-agent1:
image: teamcity-agent:2018.1.1
teamcity-agent2:
image: teamcity-agent:2018.1.1
# alpine:3.7 + git-daemon here
git-server:
build:
context: git-daemon
dockerfile: Dockerfile
ports:
- "9418:9418"
# ubuntu:18.04 + popa3d here
mail-server:
build:
context: mail-server
dockerfile: Dockerfile
ports:
- "5025:25"
- "5110:110"
You are not exposing services you want to use, I am unsure what the WaitStrategy will do in this case.
Normally we would wait for the exposed ports of the services you would interact with through the SocatContainer
.
Can you try exposing the services using withExposedService()
on the DockerComposeContainer
?
I forgot to include port mappings into example above, sorry. Edited
Versions
Problems
SocatContainer
randomly fails to start. Usingalpine/socat:1.0.3
with 5 minutes timeout forDockerComposeContainer#ambassadorContainer
andwithLocalCompose(true)
:ContainerisedDockerCompose
randomly (but very frequently) fails to start. Usingdocker/compose:1.21.2
andwithLocalCompose(false)
: