mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-08-22 22:56:17 +00:00
1.3 KiB
1.3 KiB
This is following part of OpenFaaS tempalte Readme. This template is based on clearlinux/python:3 container image. Python version is 3.8.
python3-clearlinux
- Create a function named hello-openfass
faas-cli new --lang python3-clearlinux hello-openfaas --prefix="<your-docker-username-here>"
Files tree as below.
├── hello-openfaas
│ ├── bundles.txt
│ ├── handler.py
│ ├── helper_script.sh
│ ├── __init__.py
│ └── requirements.txt
├── hello-openfaas.yml
└── template
* Put the required python packages in the "requirements.txt".
For example,
`echo "redis" >> hello-openfaas/requirements.txt`
`echo "flask" >> hello-openfaas/requirements.txt`
* Put the required Clear Linux bundles in the "bundles.txt".
For example,
`echo "openblas" >> hello-openfaas/bundles.txt`
`echo "wget" >> hello-openfaas/bundles.txt`
* Put any initial/helper operation in the "help_script.sh"
- Deploy function
faas-cli up -f hello-openfaas.yml
Then you can invoke your python function by OpenFaas UI or faas-cli.