
There are solutions, time consuming though. It requires you to be selfhosted.

Merge your third party docker image with an openruntime image

If you are not on ARM you can use https://github.com/bergkvist/includeimage which worked well for me

otherwise you can create a Dockerfile with something like

FROM openruntimes/node:v2-16.0 FROM myrep/myimage COPY --from=0 / /

it works but it creates a large image

or you can manually create a new Dockerfile adding the things you need (more complicated)

in order for appwrite to use this new image as a base image for running functions you need to tag it with the same tag

in my example it would be openruntimes/node:v2-16.0

then you can call your command on your custom container with the child_process node package

inside an appwrite nodejs cloud function

the other solutions I would think of is to create a REST service on your private docker container with the technology you prefer so you can access via http from your cloud function

a last option is to dive into the guts of appwrite executor source code ( php) and tweak things there so you can run a command directly on your container. You will end up with a good knowledge of appwrites container orchestration and flexibility to do what you want at the very low level but it might be time consuming and the risks to break things are high I think

Function to call a docker container? What exactly do you mean? And are you on cloud?

No. On self hosted environment. Someone provides me a closed docker container with the functionality I want to use in my function.
It is not all the time running, just one-shot-style of a private algorithm.

This would be interesting, not sure whether they will provide me access to the the dockerfile, and also would complicate the CI/CD a lot, but I will keep it in mind

It sounds the most reasonable, I should double check whether I can see it in the same network or how isolated is the function call from the local system.

How exactly are you supposed to use this docker image?

Get params via rest API, if I have to use the command line, execute docker command with those, wait to end, save on database the result

Rest API nice. So you'll need to host that somewhere and then your Appwrite function can make an http request to it

So, no direct support, I guess I should code it myself

I would have expected a special kind of function which does that lifting for me, takes care of the warmup times, stores results, etc

Well thank you

Appwrite functions do that but you have to implement an Appwrite function: https://appwrite.io/docs/functions#writingYourOwnFunction
We don't support running an arbitrary docker image if that's what you were looking for

Well, exactly that. I guess it will be tricky to preinitialize it… thank you for the support
Recommended threads
- error code:524 for functions running lon...
We are having this issue, no longer the function runtime or code, if it goes longer than 1 minute, there's no logs at all, just this error: **error code: 524**
- Invalid `specification` param: Specifica...
I'm self-hosting my appwrite instance on my Macbook, and I created a Python function using the command `appwrite init functions` and it outputed the below into ...
- Local function throws EACCES error when ...
I am developing an Appwrite function locally. Up until now, the process has been as smooth as butter: I edit my files, save them, and this triggers a rebuild of...
