docker.sock: permission denied when using testContainers with Podman on Windows
Asked Answered
D

2

6

My Java & Spring Boot application integration tests use testContainers and I'm using Podman on my Windows machine.

When trying to run the integration tests, I'm getting this permission error:

Failed to load ApplicationContext
    java.lang.IllegalStateException: Failed to load ApplicationContext
 .....
Caused by: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"cause":"permission denied","message":"container create: statfs /var/run/docker.sock: permission denied","response":500}

And all the integration tests fail.

Is there a specific permission command I need to provide Podman?

Dieterich answered 3/1, 2023 at 7:59 Comment(0)
C
0

I ran into the same problem trying to use testcontainers with dontet on Windows and was able to solve this by running (in a normal, non-admin terminal)

podman machine set --rootful

Be aware of potential side-effects and check the docs: https://docs.podman.io/en/latest/markdown/podman-machine-set.1.html#rootful

With this setting, testcontainers run nicely for me.

Christiansand answered 14/6, 2024 at 8:48 Comment(0)
D
-2

I was able to overcome the issue only after switching from Podman to Rancher Desktop.

Dieterich answered 22/1, 2023 at 8:36 Comment(1)
This doesn't answer the question. The user is trying to run Podman not Rancher.Jerk

© 2022 - 2025 — McMap. All rights reserved.