Last updated 6 months ago
Koyeb natively allows you to run your own, pre-built containers. With containers, you can embed all the system dependencies you need.
This is actually what we did in the Your first Stack guide. This time we will use a raw Docker image to experiment.
This example will executein an Docker container each time the Koyeb Function is invoked. The is a Koyeb generated file, which is always present in your containers and contains data about the event that triggered the execution in format.
Our example will display the content of the event received by the container on stdout, which is readable in the logs.
1functions: 2 - name: "hello-container" # The function name 3 image: ubuntu # The Docker image to use 4 command: ["cat"] # Overrides the container default command 5 args: ["/koyeb/events/in/raw"] # The arguments of the command 6
Theoption of the YAML file allows you to override the default command specified with in the Dockerfile of the container.
Theoption allows you to provide arguments to the default of the Dockerfile or the you provided.
Now, you can Invoke your function with the pre-filledevent data.
In your log files, you should see a JSON similar to:
To read about deploying from your Private Docker Container Registry or an other public Container Registry, go to our Deploy from any Docker Container Registry.