当前位置:网站首页>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
边栏推荐
- 冰冰学习笔记:一步一步带你实现顺序表
- 牛客网数据库SQL实战详细剖析(26-30)
- Thinkphp5 + data large screen display effect
- 博睿数据携手F5共同构建金融科技从代码到用户的全数据链DNA
- What is the effect of Zhongfu Jinshi wealth class 29800? Walk with professional investors to make investment easier
- Alexnet model
- 在游戏世界组建一支AI团队,超参数的多智能体「大乱斗」开赛
- How to upload large files quickly?
- The art of automation
- nuxt项目:全局获取process.env信息
猜你喜欢
Using MATLAB programming to realize the steepest descent method to solve unconstrained optimization problems
8.3 language model and data set
Swift protocol Association object resource name management multithreading GCD delay once
[untitled]
1 - first knowledge of go language
LeetCode165-比较版本号-双指针-字符串
【工厂模式详解】工厂方法模式
编程哲学——自动加载、依赖注入与控制反转
Swift - literal, literal protocol, conversion between basic data types and dictionary / array
Leetcode151 - invert words in string - String - simulation
随机推荐
select 同时接收普通数据 和 带外数据
每日一题-LeetCode396-旋转函数-递推
Leetcode153 - find the minimum value in the rotation sort array - array - binary search
Don't you know the usage scenario of the responsibility chain model?
JS -- realize click Copy function
eolink 如何助力遠程辦公
8.4 realization of recurrent neural network from zero
[NLP] HMM hidden Markov + Viterbi word segmentation
Model location setting in GIS data processing -cesium
SQL中HAVING和WHERE的区别
免费在upic中设置OneDrive或Google Drive作为图床
Unity_ Code mode add binding button click event
如何打开Win10启动文件夹?
Comment eolink facilite le télétravail
LeetCode149-直线上最多的点数-数学-哈希表
帧同步 实现
Interviewer: let's talk about the process of class loading and the mechanism of class loading (parental delegation mechanism)
Async keyword
《JVM系列》 第七章 -- 字节码执行引擎
分享3个使用工具,在家剪辑5个作品挣了400多