2020import org .junit .experimental .categories .Category ;
2121
2222import java .io .IOException ;
23+ import java .time .Duration ;
24+ import java .util .Arrays ;
2325import java .util .HashSet ;
2426import java .util .Set ;
2527import java .util .concurrent .TimeUnit ;
@@ -36,7 +38,7 @@ public abstract class SwarmCmdIT extends CmdIT {
3638
3739 private static final String DOCKER_IN_DOCKER_IMAGE_REPOSITORY = "docker" ;
3840
39- private static final String DOCKER_IN_DOCKER_IMAGE_TAG = "17.12 -dind" ;
41+ private static final String DOCKER_IN_DOCKER_IMAGE_TAG = "26.1.3 -dind" ;
4042
4143 private static final String DOCKER_IN_DOCKER_CONTAINER_PREFIX = "docker" ;
4244
@@ -105,6 +107,8 @@ protected DockerClient startDockerInDocker() throws InterruptedException {
105107 ExposedPort exposedPort = ExposedPort .tcp (2375 );
106108 CreateContainerResponse response = hostDockerClient
107109 .createContainerCmd (DOCKER_IN_DOCKER_IMAGE_REPOSITORY + ":" + DOCKER_IN_DOCKER_IMAGE_TAG )
110+ .withEntrypoint ("dockerd" )
111+ .withCmd (Arrays .asList ("--host=tcp://0.0.0.0:2375" , "--host=unix:///var/run/docker.sock" , "--tls=false" ))
108112 .withHostConfig (newHostConfig ()
109113 .withNetworkMode (NETWORK_NAME )
110114 .withPortBindings (new PortBinding (
@@ -125,7 +129,7 @@ protected DockerClient startDockerInDocker() throws InterruptedException {
125129
126130 DockerClient dockerClient = initializeDockerClient (binding );
127131
128- await ().atMost ( 5 , TimeUnit .SECONDS ).untilAsserted (() -> {
132+ await ().pollDelay ( Duration . ofSeconds ( 5 )). atMost ( 10 , TimeUnit .SECONDS ).untilAsserted (() -> {
129133 dockerClient .pingCmd ().exec ();
130134 });
131135
0 commit comments