-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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]: LocalStack doesn't start if Allow the default Docker socket to be used
is unchecked
#7678
Comments
Currently, if `DockerClientFactory.instance().getRemoteDockerUnixSocketPath()` is called without resolving the strategy then the remote docker socket can be invalid, for example, using Docker Desktop for Mac with unchecked `Allow the default Docker socket to be used` option. Fixes #7678
Currently, if `DockerClientFactory.instance().getRemoteDockerUnixSocketPath()` is called without resolving the strategy then the remote docker socket can be invalid, for example, using Docker Desktop for Mac with unchecked `Allow the default Docker socket to be used` option. Fixes #7678
Hi @eddumelendez, do you plan to release a new version including this bugfix soon? I am using localstack testcontainer on MacBook M1 with MacOS Sonoma and docker via colima VM with vmType vz and mountType virtiofs. I have the same error (only from the localstack testcontainer, my other postgresql testcontainer works): Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image localstack/localstack:2.2.0
at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:334)
at app//com.paysafe.rm.blacklists.configuration.aws.LocalStackConfiguration.localStackContainer(LocalStackConfiguration.java:30)
at app//com.paysafe.rm.blacklists.configuration.aws.LocalStackConfiguration$$EnhancerBySpringCGLIB$$c7226098.CGLIB$localStackContainer$0(<generated>)
at app//com.paysafe.rm.blacklists.configuration.aws.LocalStackConfiguration$$EnhancerBySpringCGLIB$$c7226098$$FastClassBySpringCGLIB$$ed1314e1.invoke(<generated>)
at app//org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at app//org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at app//com.paysafe.rm.blacklists.configuration.aws.LocalStackConfiguration$$EnhancerBySpringCGLIB$$c7226098.localStackContainer(<generated>)
at java.base@17.0.9/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base@17.0.9/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base@17.0.9/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base@17.0.9/java.lang.reflect.Method.invoke(Method.java:568)
at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 138 more
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
... 150 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:564)
at app//org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
... 151 more
Caused by: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"error while creating mount source path '/Users/pavlina.drosos/.colima/default/docker.sock': mkdir /Users/pavlina.drosos/.colima/default/docker.sock: operation not supported"} The error happens only if I create colima VM with vmType vz and mountType virtiofs, if vmType qemu and mountType sshfs are used instead, then the localstack testcontainer works. |
Module
LocalStack
Testcontainers version
1.19.1
Using the latest Testcontainers version?
Yes
Host OS
macos
Host Arch
ARM
Docker version
Client: Version: 24.0.6-rd API version: 1.43 Go version: go1.20.7 Git commit: da4c87c Built: Wed Sep 6 16:40:13 2023 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.24.2 (124339) 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?
LocalStackContainer
doesn't start whenAllow the default Docker socket to be used (requires password)
option in Docker Desktop for Mac is unchecked.In the following method:
testcontainers-java/core/src/main/java/org/testcontainers/DockerClientFactory.java
Lines 162 to 176 in 6e2b091
strategy
isnull
. After callinggetTransportConfig().gerDockerHost()
, the strategy will contain the right values and the docker host to be used.Let's take into account that currently, LocalStackContainer tries to mount the docker socket in the constructor and at this point no strategy has been discovered yet. The following line
testcontainers-java/modules/localstack/src/main/java/org/testcontainers/containers/localstack/LocalStackContainer.java
Line 116 in f1b0b07
can also be moved to the
configure
method.Relevant log output
Additional Information
No response
The text was updated successfully, but these errors were encountered: