eugene-khyst / podman-testcontainers

The example of using Podman with Testcontainers in Java projects, that use Gradle on Ubuntu Linux and MacOS (both x86_64 and Apple silicon).
Apache License 2.0
41 stars 6 forks source link

Kubernetes 1.26 #4

Open sametdoksanoglu opened 1 year ago

sametdoksanoglu commented 1 year ago

Hi, As you know, kubernetes decide to remove docker shim starting from 1.25. We were using docker in docker image in jenkins to run docker commands in previous kubernetes versions. But after 1.25, it is not possible I used pod below to run testcontainers tests with maven and define environment variables

kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
 name: podman-priv
spec:
 containers:
   - name: priv
     image: quay.io/podman/stable
     args:
       - sleep
       - "1000000"
     securityContext:
       privileged: true
EOF
DOCKER_HOST="unix:///run/user/$UID/podman/podman.sock" \
TESTCONTAINERS_RYUK_DISABLED="true"

it gave the error /var/run/docker.sock: no such file or directory. Do you think podman can replace docker in terms of testcontainers usage in kubernetes 1.25+?

eugene-khyst commented 1 year ago

I don't have an experience of running Podman in Kubernetes. But the error message states that Testcontainers searches docker.sock at /var/run/docker.sock instead of /run/user/$UID/podman/podman.sock. Make sure environment variables DOCKER_HOST and TESTCONTAINERS_RYUK_DISABLED are set.