当前位置: 首页 > wzjs >正文

专业做皮草的网站郑州网站推广多少钱

专业做皮草的网站,郑州网站推广多少钱,完善政府门户网站建设方案,制作流程图的网站本文内容均来自个人笔记并重新梳理,如有错误欢迎指正! 如果对您有帮助,烦请点赞、关注、转发、订阅专栏! 专栏订阅入口 | 精选文章 | Kubernetes | Docker | Linux | 羊毛资源 | 工具推荐 | 往期精彩文章 【Docker】(全…

本文内容均来自个人笔记并重新梳理,如有错误欢迎指正!

如果对您有帮助,烦请点赞、关注、转发、订阅专栏!


专栏订阅入口

| 精选文章 | Kubernetes | Docker | Linux | 羊毛资源 | 工具推荐 |


往期精彩文章

【Docker】(全网首发)Kylin V10 下 MySQL 容器内存占用异常的解决方法

【Docker】(全网首发)Kylin V10 下 MySQL 容器内存占用异常的解决方法(续)

【Linux】全面讲解 Shell 变量的那些事


目录

一、背景介绍

二、hadolint 介绍

三、hadolint 使用

1、在线检查方式

2、二进制检查方式

3、Docker 检查方式

四、hadolint 命令行选项


一、背景介绍

笔者在《专题三:Dockerfile 相关》及《Dockerfile 指令对 Docker 镜像层数的影响》等文章中已经介绍过 Dockerfile 相关知识及其运用。但是在实际工作中 Dockerfile 肯定不是随便写写就行了,而是推荐遵照最佳实践原则对其进行优化,以期达到减少镜像体积、提升构建效率及容器安全性等目标。

工欲善其事,必先利其器。本文将针对 Dockerfile 的优化介绍一款辅助工具,帮助大家提升工作效率。


二、hadolint 介绍

 hadolint 是一款专门用于检查 Dockerfile 语法的静态分析工具,可以帮助使用者构建符合最佳实践的 Docker 镜像。

hadolint 作为一个智能的 Dockerfile 筛选器,主要工作流程如下:

  • hadolint 将 Dockerfile 解析为 AST(抽象语法树),以标识与其关联的每条指令和参数

  • hadolint 根据内置的语法规则,在 AST 之上检查每条指令和参数。这些语法规则涵盖了效率、代码质量、安全性等多个方面。此外,hadolint 还使用了著名的 Shellcheck 来检查 RUN 指令中的 Bash 代码

  • Hadolint 会标记所有不符合语法规则的指令和参数,并提供针对性的优化建议 

GitHub 地址:https://github.com/hadolint/hadolint

Dockerfile 最佳实践:https://docs.docker.com/build/building/best-practices/


三、hadolint 使用
1、在线检查方式

网址:https://hadolint.github.io/hadolint/

# Dockerfile 示例
FROM debianRUN apt update && apt install -y supervisor
COPY supervisord.conf /etc/supervisor/conf.d/EXPOSE 80000
CMD ["/usr/bin/supervisord"]

将以上 Dockerfile 内容粘贴至文本框后点击 Lint 按钮,高亮部分即为 hadolint 针对语法检查结果反馈的优化建议,并可点击跳转至详情页。

图片

图片

图片

图片

2、二进制检查方式
  • 安装命令

wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
chmod +x hadolint && mv hadolint /usr/local/bin
hadolint -v
  • 检查命令
hadolint Dockerfile

  • 检查命令(忽略指定规则)
hadolint Dockerfile --ignore DL3006 --ignore DL3027

3、Docker 检查方式
docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile

图片


四、hadolint 命令行选项

# hadolint -h
hadolint - Dockerfile Linter written in HaskellUsage: hadolint [-v|--version] [-c|--config FILENAME] [DOCKERFILE...] [--file-path-in-report FILEPATHINREPORT] [--no-fail] [--no-color] [-V|--verbose] [-f|--format ARG] [--error RULECODE][--warning RULECODE] [--info RULECODE] [--style RULECODE] [--ignore RULECODE] [--trusted-registry REGISTRY (e.g. docker.io)] [--require-label LABELSCHEMA (e.g. maintainer:text)] [--strict-labels] [--disable-ignore-pragma] [-t|--failure-threshold THRESHOLD]Lint Dockerfile for errors and best practicesAvailable options:-h,--help                Show this help text-v,--version             Show version-c,--config FILENAME     Path to the configuration file--file-path-in-report FILEPATHINREPORTThe file path referenced in the generated report.This only applies for the 'checkstyle' format and isuseful when running Hadolint with Docker to set thecorrect file path.--no-fail                Don't exit with a failure status code when any ruleis violated--no-color               Don't colorize output-V,--verbose             Enables verbose logging of hadolint's output tostderr-f,--format ARG          The output format for the results [tty | json |checkstyle | codeclimate | gitlab_codeclimate | gnu |codacy | sonarqube | sarif] (default: tty)--error RULECODE         Make the rule `RULECODE` have the level `error`--warning RULECODE       Make the rule `RULECODE` have the level `warning`--info RULECODE          Make the rule `RULECODE` have the level `info`--style RULECODE         Make the rule `RULECODE` have the level `style`--ignore RULECODE        A rule to ignore. If present, the ignore list in theconfig file is ignored--trusted-registry REGISTRY (e.g. docker.io)A docker registry to allow to appear in FROMinstructions--require-label LABELSCHEMA (e.g. maintainer:text)The option --require-label=label:format makesHadolint check that the label `label` conforms toformat requirement `format`--strict-labels          Do not permit labels other than specified in`label-schema`--disable-ignore-pragma  Disable inline ignore pragmas `# hadolintignore=DLxxxx`-t,--failure-threshold THRESHOLDExit with failure code only when rules with aseverity equal to or above THRESHOLD are violated.Accepted values: [error | warning | info | style |ignore | none] (default: info)

http://www.dtcms.com/wzjs/169003.html

相关文章:

  • 网页是什么样子的网站优化排名易下拉霸屏
  • 域名申请好了 怎么做网站长沙搜索排名优化公司
  • 徐州市网站开发seo技巧优化
  • 无障碍浏览网站怎么做整站优化
  • 广州番禺网站制作推广淘宝seo排名优化的方法
  • 阿里云建网站步骤网红推广
  • 基本信息型网站有哪些济南网站推广公司
  • 网站建设与管期末试题网站设计流程
  • 网站流量 次天津百度推广电话号码
  • 微博如何做外链到时自己网站seo快速排名首页
  • Wordpress垂直类目站模版小程序开发收费价目表
  • 新闻类网站怎么做seo百度搜索app免费下载
  • 广州新塘网站建设推广公司网站推广优化流程
  • 小语种网站建设要点google服务框架
  • 微信网站开发教程百度网页版入口
  • wordpress热门文章页面信息流优化师简历怎么写
  • 做研学的网站百度大数据分析
  • 公司做网站怎么做百度广告怎么做
  • 湖南佳邦建设有限公司网站网上开店如何推广自己的网店
  • 网站建设平台设备百度云登录入口官网
  • 婚介 东莞网站建设全自动精准引流软件
  • 毕设电商网站设计seo站长工具 论坛
  • 标准网站建设推荐推广活动策划方案范文
  • 个人网站如何做流量seo是指什么意思
  • 专业模板建站哪家好沈阳市网站
  • 互联网产品做网站好还是小程序成都百度seo推广
  • 江门网站推广软件东莞seo网络公司
  • 百度里面企业网站怎么建设网站更换服务器对seo的影响
  • 小程序源码网站论坛关键词查找工具
  • 郑州网站建站网站维护一般都是维护什么