Skip to content

Commit

Permalink
update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
l10178 committed Oct 23, 2024
1 parent 81afda4 commit d4bb048
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
10 changes: 9 additions & 1 deletion content/blog/docker-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ seo:

## 多架构编译

如果你本身具备多架构的机器资源,使用 docker 远端 builder 或 [GoogleContainerTools/kaniko](https://github.com/GoogleContainerTools/kaniko) 同架构编译,速度和性能是最理想的。高度依赖指令集的应用,跨架构编译可能需要 3 小时,而同架构只需要 10 分钟。
如果你本身具备多架构的机器资源,使用 docker 远端 builder 或 [GoogleContainerTools/kaniko](https://github.com/GoogleContainerTools/kaniko) 同架构编译,速度和性能是最理想的。高度依赖指令集的应用,比如某些老 python 包无 arm 版本触发编译,跨架构编译可能需要 3 小时,而同架构只需要 10 分钟。

kaniko 支持“多架构编译”,但是不支持跨架构编译,不能在 amd64 机器上编译 arm64 容器,如果需要多架构只能在不同机器上多次编译,然后使用 manifest-tool 合并。

Expand Down Expand Up @@ -183,12 +183,20 @@ RUN apt-get update && apt-get install -y curl

## 辅助工具

### hadolint

[hadolint](https://github.com/hadolint/hadolint) 是一个 Dockerfile 语法检测工具,根据最近实践检测语法给出修改方式。

可以用命令行执行,可以 Docker 镜像执行,也可以使用 [Online 在线分析](https://hadolint.github.io/hadolin)

### skopeo

[skopeo](https://github.com/containers/skopeo) 是一个镜像搬运工具。

不需要运行守护进程,用于对容器镜像与容器仓库执行管理操作的命令行工具,支持 OCI 镜像与 Docker V2 镜像。

主要用于跨仓库之间镜像复制,镜像仓库与本地文件同步。

看一下他的 help 就知道什么意思了。

```console
Expand Down
9 changes: 8 additions & 1 deletion hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@
"categories",
"chroma",
"col",
"col-lg-1",
"col-lg-10",
"col-lg-11",
"col-lg-12",
"col-lg-5",
"col-lg-7",
"col-lg-8",
"col-lg-9",
"col-md-1",
"col-md-11",
"col-md-12",
"col-xl-3",
"col-xl-4",
Expand Down Expand Up @@ -265,6 +268,7 @@
"h-rh-i-4",
"h-rh-i-5",
"h-rh-i-6",
"hadolint",
"install-keda",
"jacolinehttpsjacolinedevinspect",
"jar-方式运行",
Expand All @@ -274,6 +278,7 @@
"jemalloc",
"k3s-traefik-对接-oauth2-proxy-特别说明",
"keycloak-对接-oauth2-proxy-特别说明",
"keycloak-配置",
"kubeadm-安装问题",
"license",
"lima-快速入门",
Expand All @@ -282,6 +287,7 @@
"multipass-快速安装-k3s",
"nacos-服务端部署",
"nginx-使用-auth_request-对接-oauth2-proxy",
"oauth2-proxy-配置",
"offcanvasNavMain",
"offcanvasNavMainLabel",
"offcanvasNavSection",
Expand All @@ -304,6 +310,7 @@
"tldr",
"toTop",
"toc",
"traefik-配置",
"war-配置转移",
"不同-jvm-参数内存占用对比",
"主要-starter-使用说明",
Expand All @@ -328,6 +335,7 @@
"基本原理和流程",
"基础设施标准化",
"备考环境",
"多架构编译",
"安装和使用问题记录",
"客户端负载均衡和服务端负载均衡",
"对象类型作为热点参数",
Expand All @@ -339,7 +347,6 @@
"快速入门",
"快速开始",
"总结",
"我们的镜像策略",
"技术选项",
"接入指导",
"推荐配置",
Expand Down
6 changes: 3 additions & 3 deletions layouts/blog/single.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ define "main" }}
<article>
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<div class="col-md-12 col-lg-11">
<div class="blog-header">
<h2>{{ .Title }}</h2>
<h1>{{ .Title }}</h1>
{{ partial "main/blog-meta.html" . }}
</div>
</div>
Expand All @@ -22,7 +22,7 @@ <h2>{{ .Title }}</h2>
</div>
{{ end -}}
{{ end -}}
<div class="col-md-12 col-lg-10">
<div class="col-md-12 col-lg-11">
{{ with .Params.summary -}}<p class="lead">{{ . }}</p>{{ end -}}
{{ .Content }}
{{ if .Params.tags -}}
Expand Down

0 comments on commit d4bb048

Please sign in to comment.