当前位置:网站首页>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
边栏推荐
- we引用My97DatePicker 实现时间插件使用
- Nuxt project: Global get process Env information
- Sword finger offer II 019 Delete at most one character to get palindrome (simple)
- 解决computed属性与input的blur事件冲突问题
- thinkphp5+数据大屏展示效果
- 8.5 concise implementation of cyclic neural network
- PCIe X1 插槽的主要用途是什么?
- select 同时接收普通数据 和 带外数据
- Tencent has written a few words, Ali has written them all for a month
- Brute force of DVWA low -- > High
猜你喜欢
Svn detailed use tutorial
LeetCode165-比较版本号-双指针-字符串
nuxt项目:全局获取process.env信息
[NLP] HMM hidden Markov + Viterbi word segmentation
8.2 text preprocessing
在游戏世界组建一支AI团队,超参数的多智能体「大乱斗」开赛
LeetCode 练习——396. 旋转函数
1n5408-asemi rectifier diode
QT Detailed explanation of pro file
Introduction to distributed transaction Seata
随机推荐
JS - implémenter la fonction de copie par clic
Epolloneshot event of epoll -- instance program
编程哲学——自动加载、依赖注入与控制反转
利用 MATLAB 编程实现最速下降法求解无约束最优化问题
Vous ne connaissez pas encore les scénarios d'utilisation du modèle de chaîne de responsabilité?
Bingbing learning notes: take you step by step to realize the sequence table
填充每个节点的下一个右侧节点指针 II [经典层次遍历 | 视为链表 ]
js——实现点击复制功能
How to write the keywords in the cover and title? As we media, why is there no video playback
Set onedrive or Google drive as a drawing bed in upic for free
Explanation and example application of the principle of logistic regression in machine learning
Leetcode165 compare version number double pointer string
Swift Protocol 关联对象 资源名称管理 多线程GCD 延迟 once
【JZ46 把数字翻译成字符串】
[stc8g2k64s4] introduction of comparator and sample program of comparator power down detection
Thread synchronization, life cycle
Resolve the conflict between computed attribute and input blur event
8.5 concise implementation of cyclic neural network
UML learning_ Day2
1n5408-asemi rectifier diode