feat: add README
This commit is contained in:
0
src/docker-registry/.env.example
Normal file
0
src/docker-registry/.env.example
Normal file
37
src/docker-registry/README.md
Normal file
37
src/docker-registry/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Docker Registry
|
||||
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
This service sets up a private Docker registry.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Generate a TLS certificate for your server.
|
||||
2. Place the certificate and key files (in PEM format) into the `certs/` directory.
|
||||
3. Create a `.env` file and configure the following variables:
|
||||
|
||||
```bash
|
||||
REGISTRY_HTTP_TLS_CERTIFICATE=your_cert.crt
|
||||
REGISTRY_HTTP_TLS_KEY=your_key.key
|
||||
```
|
||||
|
||||
## Services
|
||||
|
||||
- `registry`: The Docker registry service.
|
||||
|
||||
## Configuration
|
||||
|
||||
- `REGISTRY_VERSION`: The version of the registry image, default is `3.0.0`.
|
||||
- `REGISTRY_PORT`: The port for the registry service, default is `5000`.
|
||||
- `REGISTRY_AUTH`: The authentication method, default is `htpasswd`.
|
||||
- `REGISTRY_AUTH_HTPASSWD_REALM`: The realm for htpasswd authentication, default is `Registry Realm`.
|
||||
- `REGISTRY_AUTH_HTPASSWD_PATH`: The path to the htpasswd file, default is `/certs/passwd`.
|
||||
- `REGISTRY_HTTP_TLS_CERTIFICATE`: The TLS certificate file.
|
||||
- `REGISTRY_HTTP_TLS_KEY`: The TLS key file.
|
||||
- `OTEL_TRACES_EXPORTER`: Set to `none` to disable tracing.
|
||||
|
||||
## Volumes
|
||||
|
||||
- `certs`: For storing TLS certificates.
|
||||
- `config.yml`: The registry configuration file.
|
||||
- `registry`: A volume for storing registry data.
|
||||
@@ -1,14 +1,37 @@
|
||||
# Docker 镜像仓库
|
||||
|
||||
请参考教程 [搭建私有 Docker 镜像仓库](https://docs.alexsun.top/public/ops/docker/docker-registry/)。
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
需要先 [给服务器生成一张证书](https://docs.alexsun.top/public/blog/2024-06/certs-maker.html),然后将证书放到服务器上的 `certs/` 文件夹下面,请使用 PEM 格式的证书。
|
||||
此服务用于搭建一个私有的 Docker 镜像仓库。
|
||||
|
||||
配置 `.env` 文件:
|
||||
## 前提条件
|
||||
|
||||
```bash
|
||||
REGISTRY_HTTP_TLS_CERTIFICATE=xxxxxx.crt
|
||||
REGISTRY_HTTP_TLS_KEY=xxxxxx.key
|
||||
```
|
||||
1. 为您的服务器生成一张 TLS 证书。
|
||||
2. 将证书和密钥文件(PEM 格式)放置在 `certs/` 目录下。
|
||||
3. 创建 `.env` 文件并配置以下变量:
|
||||
|
||||
使用 `OTEL_TRACES_EXPORTER=none` 停用观测。
|
||||
```bash
|
||||
REGISTRY_HTTP_TLS_CERTIFICATE=your_cert.crt
|
||||
REGISTRY_HTTP_TLS_KEY=your_key.key
|
||||
```
|
||||
|
||||
## 服务
|
||||
|
||||
- `registry`: Docker 镜像仓库服务。
|
||||
|
||||
## 配置
|
||||
|
||||
- `REGISTRY_VERSION`: 镜像仓库的版本,默认为 `3.0.0`。
|
||||
- `REGISTRY_PORT`: 镜像仓库服务的端口,默认为 `5000`。
|
||||
- `REGISTRY_AUTH`: 认证方式,默认为 `htpasswd`。
|
||||
- `REGISTRY_AUTH_HTPASSWD_REALM`: htpasswd 认证的领域,默认为 `Registry Realm`。
|
||||
- `REGISTRY_AUTH_HTPASSWD_PATH`: htpasswd 文件的路径,默认为 `/certs/passwd`。
|
||||
- `REGISTRY_HTTP_TLS_CERTIFICATE`: TLS 证书文件。
|
||||
- `REGISTRY_HTTP_TLS_KEY`: TLS 密钥文件。
|
||||
- `OTEL_TRACES_EXPORTER`: 设置为 `none` 以禁用追踪。
|
||||
|
||||
## 卷
|
||||
|
||||
- `certs`: 用于存放 TLS 证书。
|
||||
- `config.yml`: 镜像仓库的配置文件。
|
||||
- `registry`: 用于存储镜像仓库数据的卷。
|
||||
|
||||
Reference in New Issue
Block a user