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

Support Colima out of the box #6927

Closed
wants to merge 1 commit into from

Conversation

glasser
Copy link

@glasser glasser commented Apr 19, 2023

This is related to #5837, though I'm not sure if it fully fixes it.

This makes two changes that make testcontainers work with Colima with no configuration for me:

  • Since v3.3 docker-java supports looking in the context file to discover the Docker host, but EnvironmentAndSystemPropertyClientProviderStrategy ignored that. This change makes it so that if DefaultDockerClientConfig.Builder.build ever returns a non-default docker-host, it is used.
  • With Colima, the path that you use to refer to the docker socket when setting up container volumes is different from the path you use to directly connect to Docker, because within the VM, you just use the standard /var/run/docker.sock. Add some hardcoded logic to always use /var/run/docker.sock if the chosen socket appears to be from Colima; you can always override with $TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE.

This is related to testcontainers#5837, though I'm not sure if it fully fixes it.

This makes two changes that make testcontainers work with Colima with no
configuration for me:

- Since v3.3 docker-java supports looking in the context file to
  discover the Docker host, but
  EnvironmentAndSystemPropertyClientProviderStrategy ignored that. This
  change makes it so that if `DefaultDockerClientConfig.Builder.build`
  ever returns a non-default docker-host, it is used.
- With Colima, the path that you use to refer to the docker socket when
  setting up container volumes is different from the path you use to
  directly connect to Docker, because within the VM, you just use the
  standard `/var/run/docker.sock`. Add some hardcoded logic to always
  use `/var/run/docker.sock` if the chosen socket appears to be from
  Colima; you can always override with
  $TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE.
@eddumelendez
Copy link
Member

Thanks for the PR, @glasser. Sadly, this is not enough to make sure Testcontainers for Java works with Colima. There is an ongoing work on Testcontainers for Node, see this PR and the lessons are going to be shared in order to support it cross languages implementations.

@glasser
Copy link
Author

glasser commented Apr 19, 2023

It does work on my computer, though I see that your PR there actually tests it in Colima, which is great. I guess we can use my fork in my project for now, if it seems like testcontainers-java is likely to support Colima relatively soon!

@jordanjennings
Copy link

@eddumelendez It's been a while since this was in motion, but are you aware of any current work to support this? The node PR you linked was closed and I am unable to find any updates or direction (if there is any) on work to support Colima properly. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants