Skip to content
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

[Bug]: testcontainers-java tests are failing with timeout starting ryuk container #9223

Closed
jpmartins-ca opened this issue Sep 13, 2024 · 1 comment
Labels

Comments

@jpmartins-ca
Copy link

Module

Core

Testcontainers version

1.20.1

Using the latest Testcontainers version?

Yes

Host OS

macOs 14.6.1

Host Arch

ARM64

Docker version

Client:
 Cloud integration: v1.0.35+desktop.4
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:28:49 2023
 OS/Arch:           darwin/arm64
 Context:           default

Server: Docker Desktop 4.23.0 (120376)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

The tests for testcontainer-java fail on my machine, for example ArtemisContainerTest should pass, instead it fails. Trying to troubleshooting it myself and launching ryuk directly led me to believe the source of the timeout is ryuk not finding the docker.sock that is under my user home directory. I have no sudo or root and it is almost impossible to link the docker.sock to /var/run/docker.sock.

Relevant log output

Log of the test in attach [ArtemisContainerTest.defaultCredentials.log](https://github.com/user-attachments/files/16994156/ArtemisContainerTest.defaultCredentials.log)

Key being:


Container startup failed for image testcontainers/ryuk:0.9.0
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.9.0


### Additional Information

My local docker daemon is working normally.
Environment variable DOCKER_HOST was set to try to get it working, without success.

Take into account I do not have admin/root/sudo that limits what I can do.

Did open a ticket in past [in this project](https://github.com/testcontainers/testcontainers-java/issues/9218), and a ticket to [ryuk](https://github.com/testcontainers/moby-ryuk/issues/161) trying to unlock this.
@jpmartins-ca
Copy link
Author

jpmartins-ca commented Sep 13, 2024

Investigation following Slack and testcontainers/moby-ryuk#161 lead to identify the cause, if docker.sock cannot be on the expected place (/var/run/docker.sock). 1) Two options have DOCKER_HOST point to docker.sock of docker and TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE point to place where it is expected:

export DOCKER_HOST=unix://$HOME/.docker/run/docker.sock
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
  1. Or do not have defined DOCKER_HOST and TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE and for Docker Desktop they are automaticly detected (tested on 1.19.1 and 1.20.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant