testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.04k stars 1.65k forks source link

"Unable to mount a file from test host into a running container" on Mac M1 #4168

Open todor-kolev opened 3 years ago

todor-kolev commented 3 years ago

I get the above error but I am able to start a container with a bind mount. For example this work on my machine:

docker run -d \
  -it \
  --name devtest \
  --mount type=bind,source="$(pwd)"/target,target=/app \
  nginx:latest

But running a test with testcontainers localstack I get :

Unable to mount a file from test host into a running container. This may be a misconfiguration or limitation of your Docker environment. Some features might not work.

Docker version 3.4.0 testcontainers version: 1.15.3 Mac M1

Any ideas?

I initially experienced this issue when trying to run a test with KPL producer sending messages to Kinesis:


⚠︎ Unable to mount a file from test host into a running container. This may be a misconfiguration or limitation of your Docker environment. Some features might not work.
[kpl-daemon-0003] ERROR com.amazonaws.services.kinesis.producer.LogInputStreamReader - [0x00006c9a][0x00000003061dc000] [error] [shard_map.cc:154] Shard map update for stream "invalid-stream" failed. Code: ResourceNotFoundException Message: Stream invalid-stream under account 000000000000 not found. with address : 127.0.0.1; retrying in 1000 ms
rpanov-unitq commented 3 years ago

Same here. Docker 3.5.1 (66090) (version for Apple Silicon from here) Engine - 20.10.7 testcontainers version: 1.15.3 MacBook Pro M1

Trying to run localstack image (0.11.3 - runs with the issue above. 0.12.13 - fails to run) with Kinesis and DynamoDB services.

Any updates?

rnorth commented 3 years ago

Please could you share a code example that exhibits the problem?

rpanov-unitq commented 3 years ago

Please could you share a code example that exhibits the problem?

@rnorth , please find the sample project attached: testcontainers-failure.zip

rpanov-unitq commented 3 years ago

@rnorth , any update on this one?

Ronnie5387052 commented 1 year ago

@rpanov-unitq,hi,Has this problem been solved?

rpanov-unitq commented 1 year ago

@Ronnie5387052 , It's been solved just by upgrading testcontainers version.