当前位置:网站首页>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
边栏推荐
- UML learning_ Day2
- Swift Protocol 关联对象 资源名称管理 多线程GCD 延迟 once
- 电容
- 大文件如何快速上传?
- GIS数据处理-cesium中模型位置设置
- Detailed comparison between asemi three-phase rectifier bridge and single-phase rectifier bridge
- Advanced application of I / O multiplexing: Processing TCP and UDP services at the same time
- How to upload large files quickly?
- SQL中HAVING和WHERE的区别
- JS -- realize click Copy function
猜你喜欢
8.4 realization of recurrent neural network from zero
Thread synchronization, life cycle
Redis主从同步
Thinkphp5 + data large screen display effect
你還不知道責任鏈模式的使用場景嗎?
电容
Set up an AI team in the game world and start the super parametric multi-agent "chaos fight"
Tencent has written a few words, Ali has written them all for a month
OC to swift conditional compilation, marking, macro, log, version detection, expiration prompt
【JZ46 把数字翻译成字符串】
随机推荐
eolink 如何助力遠程辦公
22年了你还不知道文件包含漏洞?
Don't you know the usage scenario of the responsibility chain model?
分布式事务Seata介绍
Using MATLAB programming to realize the steepest descent method to solve unconstrained optimization problems
小红书 timestamp2 (2022/04/22)
Thinkphp5 + data large screen display effect
脏读、不可重复读和幻读介绍
js——實現點擊複制功能
科技的成就(二十一)
LeetCode 练习——396. 旋转函数
we引用My97DatePicker 实现时间插件使用
买卖股票的最佳时机系列问题
js——实现点击复制功能
Practice of unified storage technology of oppo data Lake
Leetcode162 - find peak - dichotomy - array
OC 转 Swift 条件编译、标记、宏、 Log、 版本检测、过期提示
UML学习_day2
SQLSERVER事物与锁的问题
中富金石财富班29800效果如何?与专业投资者同行让投资更简单