-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic port binding with ExposedPorts option stopped working #518
Comments
Tried the latest commit on v3, still fails. |
Tried 3.6.0 and it fails in the same way. May be it's caused by some change in Docker. |
Exactly the same issue here
here is the code that fails: zookeeperResource, err := env.pool.RunWithOptions(&dockertest.RunOptions{
Name: "int-zookeeper",
Repository: "confluentinc/cp-zookeeper",
Tag: "7.4.0",
NetworkID: env.network.Network.ID,
Hostname: "zookeeper",
ExposedPorts: []string{"2181"},
Mounts: []string{projectRootPath + "/deploy/secrets/kafka:/etc/kafka/secrets"},
Env: []string{
"ZOOKEEPER_CLIENT_PORT=2181",
"ZOOKEEPER_TICK_TIME=2000",
"KAFKA_OPTS=-Djava.security.auth.login.config=/etc/kafka/secrets/zookeeper_jaas.conf -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.allowSaslFailedClients=false -Dzookeeper.requireClientAuthScheme=sasl",
},
}) |
Same issue, but found a workaround. |
Based on the doc for POST /containers/create Apparently previous docker engine API fallbacks to tcp, I couldn't find any related changelog though. |
adding "/tcp" to the value helps and results in expected behavior. I believe that Docker doesn't validate input in the API call and at some point invalid input worked and now it doesn't. This bug shouldn't be closed. This examples should be changed, so other people avoid falling into the same trap. |
Might this be related to Docker v27.x? I also see this behavior popping up with v27.x but it was working with v26.x. |
adding "/tcp" to the value makes the issue go away on my end. |
Coincidentally, today I updated my local docker and started facing the same issue.
I can confirm the port is not in use by other applications. Adding "/tcp" works. |
This must have been caused by a docker dependency upgrade. Thanks for working out the solution. PRs to update examples are appreciated. |
Looks like something changed in the Docker API and now it no longer defaults ports to `<port>/tcp` when `/tcp` omitted. Details here: ory/dockertest#518 Signed-off-by: Mihai Todor <[email protected]>
Looks like something changed in the Docker API and now it no longer defaults ports to `<port>/tcp` when `/tcp` omitted. Details here: ory/dockertest#518. Signed-off-by: Mihai Todor <[email protected]>
Looks like something changed in the Docker API and now it no longer defaults ports to `<port>/tcp` when `/tcp` omitted. Details here: ory/dockertest#518. Signed-off-by: Mihai Todor <[email protected]>
Preflight checklist
Ory Network Project
No response
Describe the bug
The following code stopped working:
ExposedPort is important part.
Tests work if I bind to static ports, but I don't want to.
Tests work if I don't use ExposedPorts, but then I can not get console port. The following code returns empty result.
Reproducing the bug
Run an example with dynamic port binding with docker on mac os X.
Relevant log output
Relevant configuration
No response
Version
v3.10.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker
Additional Context
Mac OS 14.5 (23F79) on Intel CPU
The text was updated successfully, but these errors were encountered: