[DEV] 기록
[Springboot] Mac에서 TestContainers Docker 감지 못할 때 해결 방법
꾸준함.
2025. 4. 24. 16:54
개요
Docker Desktop이 실행 중임에도 불구하고 테스트 코드를 실행할 때 다음과 같은 에러가 발생했습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR [Alice]: o.t.d.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were: | |
ERROR [Alice]: o.t.d.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock) | |
ERROR [Alice]: o.t.d.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue | |
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration |
해결 방법
Mac OS의 경우 다음 명령어를 터미널에 입력하면 문제가 해결됩니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ln -s $HOME/.docker/run/docker.sock /var/run/docker.sock |
출처
https://java.testcontainers.org/supported_docker_environment/
General Container runtime requirements - Testcontainers for Java
General Container runtime requirements Overview To run Testcontainers-based tests, you need a Docker-API compatible container runtime, such as using Testcontainers Cloud or installing Docker locally. During development, Testcontainers is actively tested ag
java.testcontainers.org
반응형