testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

Ryuk container in Docker-Toolbox on Windows 7

Open trevorpgray opened this issue 8 years ago • 11 comments

I ran into an issue on Windows 7 using testcontainers 1.6.0

The issue presented the same as #84, specifically issue-84-comment

So the error comes when testcontainers makes the startup checks and tries to mount C:\Users\user\AppData\Local\Temp.testcontainers-tmp-6153256460751889885:/dummy:ro Error from docker daemon is:

{"message":"invalid volume specification: 'C:\Users\user\AppData\Local\Temp\.testcontainers-tmp-6153256460751889885:/dummy:ro'"}

Disabling checks was the proposed workaround, however t seems like the problem is that the ryuk container attempts to mount the volume regardless of whether or not the checks are run: https://github.com/testcontainers/testcontainers-java/blob/87e22ec774e4c6b3899166eb27f262c721e0895f/core/src/main/java/org/testcontainers/utility/ResourceReaper.java#L80-L81

https://github.com/testcontainers/testcontainers-java/blob/87e22ec774e4c6b3899166eb27f262c721e0895f/core/src/main/java/org/testcontainers/DockerClientFactory.java#L116-L126

The workaround is to downgrade to version 1.5.1 (before the ryuk container) and disable the checks.

trevorpgray avatar Mar 05 '18 15:03 trevorpgray

Hi @trevorpgray,

Thanks for reporting! Yes, the problem is indeed coming from not working file mounting on docker-machine + Windows, we will fix it soon and release with a next version. We also appreciate a Pull Request if you want to fix it yourself 👍

bsideup avatar Mar 05 '18 15:03 bsideup

curiously, for me ryuk launches fine in windows, just the actual to be tested container fails to launch. fyi, i tried building the code, but it fails to compile, missing dependencies. after dealing with those, i tried publish to local, but only the main jarv was published, parent jar wasnt . i gave up at that point.

jeacott avatar Mar 08 '18 07:03 jeacott

@jeacott were you using the latest master? What it outputs when you run ./gradlew build?

bsideup avatar Mar 08 '18 07:03 bsideup

yes, latest master ./gradlew build -x test -x jarFileTest ./gradlew publishToMavenLocal -x test -x jarFileTest

(jarFileTest always failed and I just wanted a build to play with)

had to add testCompile group: 'org.assertj', name: 'assertj-core', version: '3.9.1' testCompile group: 'asm', name: 'asm-all', version: '3.3.1'

and a version='xxx' (not sure where the version is being managed - coudlnt find anything).

jeacott1 avatar Mar 08 '18 07:03 jeacott1

I can confirm that 1.5.1 successfully launches the container on win10, but miserably fails detecting when its up because it relies on shell scripts.

@bsideup I'm not sure if this is related to your 'not working file mounting on docker-machine + Windows" but when I first ran testContainers I had to accept a security dialog allowing access to the disk, after that ryuk launched fine, but something else in the container config appears to prevent the target launching in 1.6

jeacott1 avatar Mar 08 '18 23:03 jeacott1

Should be fixed by this PR: https://github.com/testcontainers/testcontainers-java/pull/604

bsideup avatar Mar 12 '18 15:03 bsideup

actually, its working fine for me on win10 as is, happily using both postgres and elasticsearch modules now. elasticsearch doesnt work in default mode - something about the x-pack plugin. so use the oss version and its fine. - but for some reason the elasticsearch module does require me to delete my .docker/config.json file or it doesn't work.

jeacott1 avatar Mar 15 '18 04:03 jeacott1

@jeacott1 As mentioned in the other issue, I assume it might be an incompatibility with wincred store.

@trevorpgray Can you verify if #604 has fixed it for you in Docker Toolbox on Windows 7?

kiview avatar Mar 15 '18 13:03 kiview

the thing is that the wincred setting works fine with the postgres container for me. it only has an issue with elasticsearch afaik.

jeacott1 avatar Mar 15 '18 22:03 jeacott1

Fixed in #604 (to be released very soon)

bsideup avatar Apr 06 '18 09:04 bsideup

Released in 1.7.0 (already in Bintray's JCenter, will be synced with Maven Central soon)

bsideup avatar Apr 07 '18 17:04 bsideup