Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add buildkit insecure build args #834

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/ops-guide/management/buildkit-args.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: 调整 Buildkit 构建参数
descrition: 该章节文档适用于运维人员了解如何指定集群构建
keywords:
- Rainbond 集群构建参数
- 调整 BuildKit 构建参数
---

## 使用自定义私有镜像仓库

自v5.15后Kaniko替换成Buildkit,之前版本参考 [调整 Kaniko 构建参数](/docs/ops-guide/management/kaniko-args.md),默认情况下无需调整 BuildKit 构建参数,如使用了 http 私有镜像仓库,需要调整 BuildKit 构建参数。

### 修改容器配置

Docker 配置 `/etc/docker/daemon.json`,添加私有镜像仓库地址:

```json
{
"insecure-registries": ["http://xxx.xxx.xxx.xxx:5000"]
}
```

Containerd 配置 `/etc/containerd/config.toml`,添加私有镜像仓库地址:

```toml
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."http://xxx.xxx.xxx.xxx:5000"]
endpoint = ["http://xxx.xxx.xxx.xxx:5000"]
```

### 修改 Buidkit 构建参数

修改 Kaniko 构建参数,添加私有镜像仓库地址:

```bash title="kubectl edit rbdcomponent rbd-chaos -n rbd-system"
apiVersion: rainbond.io/v1alpha1
kind: RbdComponent
......
spec:
args:
- --buildkit-args=http=true&insecure=true
......
```

## 更多参数

更多参数参考 [buildkit 官方文档](https://github.com/moby/buildkit)
18 changes: 16 additions & 2 deletions docs/ops-guide/management/kaniko-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords:

## 使用自定义私有镜像仓库

默认情况下无需调整 Kaniko 构建参数,如使用了 http 私有镜像仓库,需要调整 Kaniko 构建参数。
自v5.15后Kaniko替换成了Buildkit,参考 [调整 Buildkit 构建参数](/docs/ops-guide/management/buildkit-args.md),Kaniko适用于v5.15之前版本。默认情况下无需调整 Kaniko 构建参数,如使用了 http 私有镜像仓库,需要调整 Kaniko 构建参数。

### 修改容器配置

Expand All @@ -28,6 +28,20 @@ Containerd 配置 `/etc/containerd/config.toml`,添加私有镜像仓库地址
endpoint = ["http://xxx.xxx.xxx.xxx:5000"]
```

### 修改 Buidkit 构建参数

自v5.15后Kaniko替换成Buildkit,Buildkit添加私有镜像仓库地址:

```bash title="kubectl edit rbdcomponent rbd-chaos -n rbd-system"
apiVersion: rainbond.io/v1alpha1
kind: RbdComponent
......
spec:
args:
- --buildkit-args=http=true&insecure=true
......
```

### 修改 Kaniko 构建参数

修改 Kaniko 构建参数,添加私有镜像仓库地址:
Expand Down Expand Up @@ -73,4 +87,4 @@ spec:

## 更多参数

更多参数参考 [Kaniko 官方文档](https://github.com/GoogleContainerTools/kaniko)
更多参数参考 [Kaniko 官方文档](https://github.com/GoogleContainerTools/kaniko)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Adjust Buildkit build parameters
descrition: This section of documentation is intended for operation and maintenance personnel. Learn how to specify cluster builds
keywords:
- Rainbond 集群构建参数
- 调整 BuildKit 构建参数
---

## 使用自定义私有镜像仓库

自v5.15后Kaniko替换成Buildkit,之前版本参考 [调整 Kaniko 构建参数](/docs/ops-guide/management/kaniko-args.md),默认情况下无需调整 BuildKit 构建参数,如使用了 http 私有镜像仓库,需要调整 BuildKit 构建参数。

### 修改容器配置

Docker 配置 `/etc/docker/daemon.json`,添加私有镜像仓库地址:

```json
{
"insecure-registries": ["http://xxx.xxx.xxx.xxx:5000"]
}
```

Containerd 配置 `/etc/containerd/config.toml`,添加私有镜像仓库地址:

```toml
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."http://xxx.xxx.xxx.xxx:5000"]
endpoint = ["http://xxx.xxx.xxx.xxx:5000"]
```

### 修改 Buidkit 构建参数

修改 Kaniko 构建参数,添加私有镜像仓库地址:

```bash title="kubectl edit rbdcomponent rbd-chaos -n rbd-system"
apiVersion: rainbond.io/v1alpha1
kind: RbdComponent
......
spec:
args:
- --buildkit-args=http=true&insecure=true
......
```

## 更多参数

更多参数参考 [buildkit 官方文档](https://github.com/moby/buildkit)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords:

## 使用自定义私有镜像仓库

默认情况下无需调整 Kaniko 构建参数,如使用了 http 私有镜像仓库,需要调整 Kaniko 构建参数。
自v5.15后Kaniko替换成了Buildkit,参考 [调整 Buildkit 构建参数](/docs/ops-guide/management/buildkit-args.md),Kaniko适用于v5.15之前版本。默认情况下无需调整 Kaniko 构建参数,如使用了 http 私有镜像仓库,需要调整 Kaniko 构建参数。

### 修改容器配置

Expand Down
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ const sidebars = {
'ops-guide/management/container-runtime-switch',
'ops-guide/management/change-gateway',
'ops-guide/management/kaniko-args',
'ops-guide/management/buildkit-args',
'ops-guide/management/docker-log',
'ops-guide/management/custom-shared-storage',
'ops-guide/management/change-ports',
Expand Down