Skip to content

Commit

Permalink
Merge pull request #308 from zong-zhe/add-oci-env
Browse files Browse the repository at this point in the history
feat: add env docs for configure the OCI registry
  • Loading branch information
Peefy authored Mar 18, 2024
2 parents 5877c97 + c442c45 commit 9c3019c
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 6 deletions.
19 changes: 18 additions & 1 deletion docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL package management tool uses `ghcr.io` to save KCL packages by default.

Default registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

You can adjust the registry and repository name of the OCI registry in the configuration file. The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.
You can adjust the registry and repository name of the OCI registry by the follow methods.

### By environment variable

You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`, and `OCI_REG_PLAIN_HTTP`.

```shell
# set default registry
export KPM_REG="ghcr.io"
# set default repository
export KPM_REPO="kcl-lang"
# set support for 'http'
export OCI_REG_PLAIN_HTTP=off
```

### By configuration file

The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.

The default content of the configuration file is as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL 包管理工具默认使用 ghcr.io 保存 KCL 包。

默认 registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

可以在配置文件中调整 Registry 的地址和仓库名。KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, 如果没有设置环境变量 `KCL_PKG_PATH` 的值,则默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`
你可以通过以下方法调整 OCI Registry 的地址和仓库名称。

### 通过环境变量

你可以通过设置三个环境变量 KPM_REG、KPM_REGO 和 OCI_REG_PLAIN_HTTP 来调整配置。

```shell
# 设置默认仓库地址
export KPM_REG="ghcr.io"
# 设置默认仓库
export KPM_REPO="kcl-lang"
# 设置支持 'http'
export OCI_REG_PLAIN_HTTP=off
```

### 通过配置文件

KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`,如果环境变量 `KCL_PKG_PATH` 没有设置,它默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`

配置文件的默认内容如下:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL 包管理工具默认使用 ghcr.io 保存 KCL 包。

默认 registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

可以在配置文件中调整 Registry 的地址和仓库名。KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, 如果没有设置环境变量 `KCL_PKG_PATH` 的值,则默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`
你可以通过以下方法调整 OCI Registry 的地址和仓库名称。

### 通过环境变量

你可以通过设置三个环境变量 KPM_REG、KPM_REGO 和 OCI_REG_PLAIN_HTTP 来调整配置。

```shell
# 设置默认仓库地址
export KPM_REG="ghcr.io"
# 设置默认仓库
export KPM_REPO="kcl-lang"
# 设置支持 'http'
export OCI_REG_PLAIN_HTTP=off
```

### 通过配置文件

KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`,如果环境变量 `KCL_PKG_PATH` 没有设置,它默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`

配置文件的默认内容如下:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL 包管理工具默认使用 ghcr.io 保存 KCL 包。

默认 registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

可以在配置文件中调整 Registry 的地址和仓库名。KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, 如果没有设置环境变量 `KCL_PKG_PATH` 的值,则默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`
你可以通过以下方法调整 OCI Registry 的地址和仓库名称。

### 通过环境变量

你可以通过设置三个环境变量 KPM_REG、KPM_REGO 和 OCI_REG_PLAIN_HTTP 来调整配置。

```shell
# 设置默认仓库地址
export KPM_REG="ghcr.io"
# 设置默认仓库
export KPM_REPO="kcl-lang"
# 设置支持 'http'
export OCI_REG_PLAIN_HTTP=off
```

### 通过配置文件

KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`,如果环境变量 `KCL_PKG_PATH` 没有设置,它默认保存在 `$HOME/.kcl/kpm/.kpm/config/kpm.json`

配置文件的默认内容如下:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL package management tool uses `ghcr.io` to save KCL packages by default.

Default registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

You can adjust the registry and repository name of the OCI registry in the configuration file. The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.
You can adjust the registry and repository name of the OCI registry by the follow methods.

### By environment variable

You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`, and `OCI_REG_PLAIN_HTTP`.

```shell
# set default registry
export KPM_REG="ghcr.io"
# set default repository
export KPM_REPO="kcl-lang"
# set support for 'http'
export OCI_REG_PLAIN_HTTP=off
```

### By configuration file

The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.

The default content of the configuration file is as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ KCL package management tool uses `ghcr.io` to save KCL packages by default.

Default registry - [https://github.com/orgs/kcl-lang/packages](https://github.com/orgs/kcl-lang/packages)

You can adjust the registry and repository name of the OCI registry in the configuration file. The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.
You can adjust the registry and repository name of the OCI registry by the follow methods.

### By environment variable

You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`, and `OCI_REG_PLAIN_HTTP`.

```shell
# set the kpm default registry
export KPM_REG="ghcr.io"
# set the kpm default repository
export KPM_REPO="kcl-lang"
# set the kpm support for 'http'
export OCI_REG_PLAIN_HTTP=off
```

### By configuration file

The configuration file of the KCL package management tool is located at `$KCL_PKG_PATH/.kpm/config/kpm.json`, if the environment variable `KCL_PKG_PATH` is not set, it is saved by default in `$HOME/.kcl/kpm/.kpm/config/kpm.json`.

The default content of the configuration file is as follows:

Expand Down

0 comments on commit 9c3019c

Please sign in to comment.