当前位置:网站首页>Openfaas practice 4: template operation
Openfaas practice 4: template operation
2022-04-23 15:01:00 【InfoQ】
- go
- java11
- java11-vert-x
- node
- node12
- php7
- python
- python3
- python3-debian
- ruby
- With templates , You can create functions , The following command creates the name java-function Function of :
- Go ahead faas template store list When checking , Pay attention to the SOURCE Field , If it is openfaas-incubator, for example rust-http, Use the following command to download ( There's an extra prefix openfaas-incubator):
[](() Using third party templates
- I am here GitHub A third-party template warehouse has been built on , See how to use , Using other people's third-party templates is the same routine ;
- The so-called template warehouse , Its essence is still ordinary GitHub Warehouse , It's just that the content should be in line with OpenFaaS The requirements of ;
- My template repository address is :https://github.com/zq2599/openfaas-templates , Here's the picture :
- Download the above template repository command ( Be careful , Find a clean folder and execute the command ):
- The console operates as follows , You can see that you downloaded a template Catalog , There are two templates inside :dockerfile and java11extend:
- perform faas new --list Look at the templates , Sure enough GitHub Two in the warehouse :
- dockerfile
- java11extend
- Use templates to create functions :
- Making mirrors :
- Next, push the image to the image warehouse 、 Deployment function 、 Please refer to the previous article for verification and other operations [《OpenFaaS The third part of the actual battle :Java function 》]((), There are detailed steps , Not in this article , The following image shows that the functions made by this template can be deployed and run normally :
[](() Make your own template warehouse
- stay GitHub There's a public warehouse on ;
- All content must be placed in master Branch ;
- The warehouse should be named template Folder ;
- template In the folder , Is each template's own folder , Here's the picture , It's two templates :
- As for the contents of each template's folder , This involves template development , There's too much about it , Not in this article , Just the point :template.yml Is a function description file , There must be , And then there was Dockerfile, This is used to build a mirror image , As for other content, it is related to the characteristics of various templates , When you make a mirror image, you use , With java11 For example , contain gradle、java Related documents , It's all building java You'll use , and java The construction result of the project will be put into docker In the mirror , read Dockerfile You can see all this in detail ;
- Now in order to make templates quickly , You can copy the content of the official template , You can use it if you change it , Address :https://github.com/openfaas/templates
- When the warehouse is ready , Anyone can download the repository using commands like this :
[](() Be careful
- Now? GitHub New warehouse on , The default branch is no longer master 了 , It is mian, but fass-cli What the order says is master Branch , So please make sure that the contents of your warehouse files are in master Branch , instead of main
- When executing the command to view the official template , You can see java8 The template of , The red box is shown below , I thought it was java The good news for developers :
- These are the template related operations , This article is very important as a foundation , It is suggested that you should be familiar with the relevant commands , Lay a good foundation for further study ;
版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231416491186.html
边栏推荐
- 8.3 language model and data set
- When splicing HQL, the new field does not appear in the construction method
- Explain TCP's three handshakes in detail
- For 22 years, you didn't know the file contained vulnerabilities?
- Daily question - leetcode396 - rotation function - recursion
- [NLP] HMM hidden Markov + Viterbi word segmentation
- JS -- realize click Copy function
- epoll 的EPOLLONESHOT 事件———实例程序
- How do I open the win10 startup folder?
- PCIe X1 插槽的主要用途是什么?
猜你喜欢
Swift:Entry of program、Swift调用OC、@_silgen_name 、 OC 调用Swift、dynamic、String、Substring
Leetcode162 - find peak - dichotomy - array
分布式事务Seata介绍
The art of automation
Progress in the treatment of depression
Leetcode165 compare version number double pointer string
[NLP] HMM hidden Markov + Viterbi word segmentation
Set onedrive or Google drive as a drawing bed in upic for free
Share 20 tips for ES6 that should not be missed
win10 任务栏通知区图标不见了
随机推荐
UML学习_day2
How do I open the win10 startup folder?
How to upload large files quickly?
Redis master-slave synchronization
Resolve the conflict between computed attribute and input blur event
电容
脏读、不可重复读和幻读介绍
科技的成就(二十一)
OC 转 Swift 条件编译、标记、宏、 Log、 版本检测、过期提示
Set up an AI team in the game world and start the super parametric multi-agent "chaos fight"
Swift:Entry of program、Swift调用OC、@_silgen_name 、 OC 调用Swift、dynamic、String、Substring
Thinkphp5 + data large screen display effect
async关键字
I/O复用的高级应用之一:非阻塞 connect———使用 select 实现(也可以用 poll 实现)
Raised exception class eaccexviolation with 'access violation at address 45efd5 in module error
LeetCode167-两数之和II-双指针-二分-数组-查找
I/O复用的高级应用:同时处理 TCP 和 UDP 服务
Swift Protocol 关联对象 资源名称管理 多线程GCD 延迟 once
免费在upic中设置OneDrive或Google Drive作为图床
Swift - Literal,字面量协议,基本数据类型、dictionary/array之间的转换