apocas / dockerode

Docker + Node = Dockerode (Node.js module for Docker's Remote API)
Apache License 2.0
4.39k stars 465 forks source link

Compatibility with podman #730

Open marschal opened 1 year ago

marschal commented 1 year ago

Hi, this is rather a question or a feature request.

Are there plans to be podman compliant too? dockerode basically works with podman, except the port exposing of spawned containers. While using docker the containers have their ports open, in podman they don't (when creating using dockerode).

Best

apocas commented 1 year ago

Interesting do you have any more details?

marschal commented 1 year ago

@apocas Sure. Let me provide some additional Information. I was using dockerode for quite a long time in a JS + docker-based web application to create and interact with containers. I basically used dockerode to do things like create, start, stop, delete containers, but also to expose ports (so that docker/podman auto-allocate the port on the host, thus dynamic bindings) and configure environment variables, volume mappings and such during container creation.

According to redhat, podman should be API compatible with docker, thus I tried creating containers via dockerode on a podman backend. I noticed that it works in general, except the issue, that no port is exposed on the created podman container. Thus it looks like some incompatibility at some point. Unfortunately I could not debug deeper. This might also be just one incompatibility with podman.

drew2g commented 1 year ago

Was going to try to swap to podman but came across this. Has this been resolved recently or is there still some work to be done on it?

apocas commented 1 year ago

There are multiple projects using dockerode with podman, example: https://github.com/containers/podman-desktop/blob/main/package.json#L151

Not sure if this exact issue still exist nowadays :)

laurensV commented 8 months ago

Also couldn't manage to enable gpu support with podman through the docker api, as it seems to not do anything with DeviceRequests.. anyone know how to enable gpu support through dockerode/docker api?