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

Could not find a valid Docker environment #16541

Closed
dreab8 opened this issue Apr 15, 2021 · 11 comments
Closed

Could not find a valid Docker environment #16541

dreab8 opened this issue Apr 15, 2021 · 11 comments
Labels
area/devservices kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@dreab8
Copy link
Contributor

dreab8 commented Apr 15, 2021

Describe the bug

I'm trying to run a bug reproducer (see #16450 (comment)) and the build fails because it is not able to find a valid Docker environment.

Podman is installed on my machine

Expected behavior

The build detect and use Podman

Actual behavior

Failure with the error message

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor#launchDatabases threw an exception: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:215)
        at java.base/java.util.Optional.orElseThrow(Optional.java:408)
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:207)
        at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136)
        at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178)
        at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
        at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12)
        at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)
        at io.quarkus.devservices.postgresql.deployment.PostgresqlDevServicesProcessor$1.startDatabase(PostgresqlDevServicesProcessor.java:33)
        at io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor.startDevDb(DevServicesDatasourceProcessor.java:217)
        at io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor.launchDatabases(DevServicesDatasourceProcessor.java:103)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 26, 2021

/cc @stuartwdouglas

@famod
Copy link
Member

famod commented Aug 26, 2021

This was also reported via #19687 which has a bit more log output.

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Aug 26, 2021

I don't think this is still an issue with the latest Quarkus versions (I could not reproduce it)

@vanuatoo
Copy link

Tried with 2.2.0.CR1, same issue

@xstefank
Copy link
Member

xstefank commented Sep 1, 2021

I think this is a limitation of test containers, not quarkus.

@vanuatoo
Copy link

vanuatoo commented Sep 2, 2021

I got it running with the following approach.

  1. Start podman with the command
    podman system service -t 0
  2. export the following variables
    export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
    export TESTCONTAINERS_RYUK_DISABLED=true
  3. Run
    ./mvnw quarkus:dev

@r00ta
Copy link
Contributor

r00ta commented Sep 13, 2021

@geoand
I have the same issue with quarkus v2.2.2 (and previous) and with testcontainer v1.16.0 (and docker installed on my system).

But testcontainer v1.15.3 works without any issue.

@geoand
Copy link
Contributor

geoand commented Apr 10, 2023

Given all the changes that have gone into Quarkus 3 around Docker detection, I am going to close this.
If this is still an issue, feel free to create a new issue

@geoand geoand closed this as completed Apr 10, 2023
@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Apr 10, 2023
@ewoks
Copy link

ewoks commented May 26, 2023

@geoand is there some special/new configuration we need to do or comment from above is the final "solution-around"?
I just got the same error with:

Quarkus: 3.0.3
Java: 17.0.7-tem
Podman 4.2.0
CSB RHEL: 4.18.0-425.19.2.el8_7.x86_64 

@geoand
Copy link
Contributor

geoand commented May 26, 2023

If you are seeing the issue with Quarkus 3.1.0.CR1, then please open a new issue

@RapTho
Copy link
Contributor

RapTho commented Aug 6, 2024

I'm still facing that issue on a MacOS though. Both Docker and podman is installed. DOCKER_HOST is also set but quarkus dev still complains about a missing docker environment?

➜  ~ which podman
/opt/homebrew/bin/podman
➜  ~ which docker
/Users/raphael/.rd/bin/docker
➜  ~ echo $DOCKER_HOST
unix:///run/user/501/podman/podman.sock
➜  ~ podman --version
podman version 5.1.2
➜  ~ docker --version
Docker version 25.0.4-rd, build c4cd0a9

Anyone got dev services to run on a MacOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devservices kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

8 participants