当前位置:网站首页>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
边栏推荐
- The difference between having and where in SQL
- January 1, 1990 is Monday. Define the function date_ to_ Week (year, month, day), which realizes the function of returning the day of the week after inputting the year, month and day, such as date_ to
- Flink datastream type system typeinformation
- Set up an AI team in the game world and start the super parametric multi-agent "chaos fight"
- Chapter 7 of JVM series -- bytecode execution engine
- 你還不知道責任鏈模式的使用場景嗎?
- async关键字
- 2-Go变量操作
- [thymeleaf] handle null values and use safe operators
- LeetCode165-比较版本号-双指针-字符串
猜你喜欢
3、 Gradient descent solution θ
What is the role of the full connection layer?
Sword finger offer II 019 Delete at most one character to get palindrome (simple)
LeetCode162-寻找峰值-二分-数组
Detailed comparison between asemi three-phase rectifier bridge and single-phase rectifier bridge
Chapter 7 of JVM series -- bytecode execution engine
自动化的艺术
Set up an AI team in the game world and start the super parametric multi-agent "chaos fight"
Provided by Chengdu control panel design_ It's detailed_ Introduction to the definition, compilation and quotation of single chip microcomputer program header file
我的 Raspberry Pi Zero 2W 折腾笔记,记录一些遇到的问题和解决办法
随机推荐
Do (local scope), initializer, memory conflict, swift pointer, inout, unsafepointer, unsafebitcast, success
脏读、不可重复读和幻读介绍
UML project example -- UML diagram description of tiktok
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
Introduction to distributed transaction Seata
win10 任务栏通知区图标不见了
8.2 text preprocessing
[detailed explanation of factory mode] factory method mode
Tencent has written a few words, Ali has written them all for a month
Set onedrive or Google drive as a drawing bed in upic for free
剑指 Offer II 019. 最多删除一个字符得到回文(简单)
Redis主从同步
SQL中HAVING和WHERE的区别
Explain TCP's three handshakes in detail
Share 3 tools, edit 5 works at home and earn more than 400
LeetCode 练习——396. 旋转函数
Provided by Chengdu control panel design_ It's detailed_ Introduction to the definition, compilation and quotation of single chip microcomputer program header file
中富金石财富班29800效果如何?与专业投资者同行让投资更简单
Mds55-16-asemi rectifier module mds55-16
Share 20 tips for ES6 that should not be missed