docker-maven-plugin: docker for mac beta and docker:start with wait/tcp/ports incorrectly waits on container port

Running a maven project that uses the wait/tcp/ports functionality to wait for the container to listen on a specific port:

Observed results:

With docker-machine, the logs output

[INFO] DOCKER> [mysql:5.7] "db": Start container 5289bed0ef48
[INFO] DOCKER> [mysql:5.7] "db": Waiting for exposed ports [32780] on remote host (192.168.251.207), since they are not directly accessible.

With docker for mac beta:

[INFO] DOCKER> [mysql:5.7] "db": Start container d79b36323981
[INFO] DOCKER> [mysql:5.7] "db": Waiting for ports [3306] directly on container with IP (172.17.0.2).
[ERROR] DOCKER> [mysql:5.7] "db": Timeout after 60405 ms while waiting on tcp port '[/172.17.0.2:3306]'
[ERROR] DOCKER> Error occurred during container startup, shutting down...

Expected results:

Build should pass with either docker-machine or docker for mac

Preliminary analysis:

Something seems to be going wrong in the detection of whether the container is directly accessible.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23

Commits related to this issue

Most upvoted comments

@ol2ka , sure, just remove these tags

<wait>
            <tcp>
                        <ports>
                                       <port>

I for one haven’t had to use another work around, but reviewing the documentation. You could configure a health check that is more robust than just establishing an ephemeral connection and wait on that with the healthy wait: https://dmp.fabric8.io/#build-healthcheck

Haven’t looked at this, just tossing it out as an idea.