Function Runtime Environment Engine
- Runtime: 运行时环境,基础环境
- Template: 函数模版
- Container: 基于函数模版运行的容器(函数实例)
docker run -v $PWD:/go/src -it --privileged golang:1.14 bash docker run -v $PWD:/root -p 8080:80 -it --privileged python:3.7 bash
- 本地直接构建:go build -o free main.go
- 基于 docker: docker run -it --rm -v "$PWD":/go/src golang:1.14 bash -c "cd /go/src && go build -o free main.go"
运行前的准备
docker run -it --rm -v "$PWD":/go/src golang:1.14 bash -c "cd /go/src && go build -o free main.go"
git clone https://github.com/WuShaoling/fre-runtime.git
cd fre-runtime/python3.7 && sh build.sh ${workspace目录}
pip3 install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com scipy numpy pandas django matplotlib
或使用 docker 启动运行环境
docker run -it -v $PWD:/free --privileged -p 80:80 python:3.7 bash
# pip3 install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com scipy numpy pandas django matplotlib
# cd /free
./free
curl -X POST \
'http://localhost:80/api/container/normal?sync=true' \
-H 'content-type: application/json' \
-d '{
"key1": "hello",
"key2": "world"
}'
docker restart 0ef83d3a156a && docker exec -it 0ef83d3a156a bash -c "cd /free && rm -rf workspace/container/* && ./free"