使用本地注册表创建openfaas-function

1
docker run -d -p 5000:5000 --restart always --name registry registry:2

Test pushing the alpine image to the local registry

1
2
3
docker pull alpine
docker tag alpine localhost:5000/alpine
docker push localhost:5000/alpine

View the repositories

1
http://localhost:5000/v2/_catalog

View the images in a repository

1
http://localhost:5000/v2/alpine/tags/list

Set an environment variable to point faas-cli

1
[Environment]::SetEnvironmentVariable("OPENFAAS_URL", "http://localhost:31112", "Process""

Create a root folder for the functions

1
2
mkdir -p ~/Desktop/func
cd ~/Desktop/func

Pull the templates

1
2
faas-cli template pull
faas-cli new --list

Create a new function

1
faas-cli new --lang csharp hello-csharp --prefix="localhost:5000"

Build, push, and deploy

1
2
3
faas-cli build -f ./hello-csharp.yml
faas-cli push -f ./hello-csharp.yml
faas-cli deploy -f ./hello-csharp.yml

Test it

1
echo Hi Elijah | faas-cli invoke hello-csharp
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2020 丁振莹
  • 访问人数: | 浏览次数:

你的每一分支持,是我努力下去的最大的力量 ٩(๑❛ᴗ❛๑)۶

支付宝
微信