Using Docker api from a function #1451
-
Greetings, I was trying to create a function that can communicate with Docker: import docker
client = docker.DockerClient(base_url='unix://var/run/docker.sock')
a = client.containers.list(all=True)
print(a) When executing it from Appwrite I get the following error:
I thought it would work because in the Is there any way to configure the docker container that runs the function so I can add Thank you 🙏! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you still want to achieve that you can run your own Docker container with access to the docker.sock. This can container can expose an API that your Appwrite functions can use. Be careful and make sure only authorized clients can access this kind of proxy. |
Beta Was this translation helpful? Give feedback.
appwrite-worker-functions
has access to the docker.sock so it can spin up isolated runtime environments to run your functions. Exposing the Docker API to any function will be considered a big security weakness.If you still want to achieve that you can run your own Docker container with access to the docker.sock. This can container can expose an API that your Appwrite functions can use. Be careful and make sure only authorized clients can access this kind of proxy.