functions icon indicating copy to clipboard operation
functions copied to clipboard

Using PHP

Open meysam001 opened this issue 6 years ago • 4 comments

Hello Is it possible that I create a function with PHP instead of Python ?

meysam001 avatar Mar 14 '18 11:03 meysam001

Yes, you can use any language that you can run inside a docker container.

Please check PHP Hello example.

c0ze avatar Mar 14 '18 13:03 c0ze

I'd like to run it on Kubernetes directly. Is it possible to run on Kubernetes without docker container?

meysam001 avatar Mar 17 '18 06:03 meysam001

I'm sorry, I don't understand what you mean by "Running on Kubernetes directly".

Kubernetes is a container orchestration platform, so you will need to use some kind of containerization technology to run your function.

At the moment, Iron Functions support only Docker containers. It is possible to support other containerization platforms, but currently there are no projects underway.

c0ze avatar Mar 18 '18 08:03 c0ze

I have create the func.yaml file:

name: my_docker_username/hello
version: 0.0.1
path: /hello
build:
- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install

When I had run fn build, I gave the error:

error running command docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install (exit status 1)

What is wrong?

meysam001 avatar Mar 18 '18 08:03 meysam001