
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
docker-ocserv is an OpenConnect *** Server boxed in a Docker image built by Tommy Lau.
Update to version 0.11.8 and use Alpine 3.6 as base image
You can login with two group (Route/ALL) from now on.
Route group means you can access China Mainland website directly and other connection will be protected by OpenConnect ***
All group means all of connection will be protected by OpenConnect ***
Thanks for https://github.com/sempr's contribution and suggestion, from now on, the https://hub.docker.com/_/alpine/ will be used as the base image. The docker image size has been dramatically reduced from around 150MB to only 20MB.
NOTICE: You have to use Docker version 1.9.0 or later to support Alpine, DO NOT UPDATE the image if your Docker version is older than 1.9.0
OpenConnect server (ocserv) is an SSL *** server. It implements the OpenConnect SSL *** protocol, and has also (currently experimental) compatibility with clients using the AnyConnect SSL *** protocol.
Get the docker image by running the following commands:
bashdocker pull tommylau/ocserv
Start an ocserv instance:
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv
This will start an instance with the a test user named test and password is also test.
All the variables to this image is optional, which means you don't have to type in any environment variables, and you can have a OpenConnect Server out of the box! However, if you like to config the ocserv the way you like it, here's what you wanna know.
CA_CN, this is the common name used to generate the CA(Certificate Authority).
CA_ORG, this is the organization name used to generate the CA.
CA_DAYS, this is the expiration days used to generate the CA.
SRV_CN, this is the common name used to generate the server certification.
SRV_ORG, this is the organization name used to generate the server certification.
SRV_DAYS, this is the expiration days used to generate the server certification.
NO_TEST_USER, while this variable is set to not empty, the test user will not be created. You have to create your own user with password. The default value is to create test user with password test.
The default values of the above environment variables:
| Variable | Default |
|---|---|
| CA_CN | *** CA |
| CA_ORG | Big Corp |
| CA_DAYS | 9999 |
| SRV_CN | [***] |
| SRV_ORG | My Company |
| SRV_DAYS | 9999 |
Start an instance out of the box with username test and password test
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv
Start an instance with server name my.test.com, My Test and 365 days
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -e SRV_CN=my.test.com -e SRV_ORG="My Test" -e SRV_DAYS=365 -d tommylau/ocserv
Start an instance with CA name My CA, My Corp and 3650 days
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -e CA_CN="My CA" -e CA_ORG="My Corp" -e CA_DAYS=3650 -d tommylau/ocserv
A totally customized instance with both CA and server certification
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -e CA_CN="My CA" -e CA_ORG="My Corp" -e CA_DAYS=3650 -e SRV_CN=my.test.com -e SRV_ORG="My Test" -e SRV_DAYS=365 -d tommylau/ocserv
Start an instance as above but without test user
bashdocker run --name ocserv --privileged -p 443:443 -p 443:443/udp -e CA_CN="My CA" -e CA_ORG="My Corp" -e CA_DAYS=3650 -e SRV_CN=my.test.com -e SRV_ORG="My Test" -e SRV_DAYS=365 -e NO_TEST_USER=1 -v /some/path/to/ocpasswd:/etc/ocserv/ocpasswd -d tommylau/ocserv
WARNING: The ocserv requires the ocpasswd file to start, if NO_TEST_USER=1 is provided, there will be no ocpasswd created, which will stop the container immediately after start it. You must specific a ocpasswd file pointed to /etc/ocserv/ocpasswd by using the volume argument -v by docker as demonstrated above.
All the users opertaions happened while the container is running. If you used a different container name other than ocserv, then you have to change the container name accordingly.
Add user
If say, you want to create a user named tommy, type the following command
bashdocker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -g "Route,All" tommy Enter password: Re-enter password:
When prompt for password, type the password twice, then you will have the user with the password you want.
-g "Route,ALL"means add usertommyto groupRouteand groupAll
Delete user
Delete user is similar to add user, just add another argument -d to the command line
bashdocker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -d test
The above command will delete the default user test, if you start the instance without using environment variable NO_TEST_USER.
Change password
Change password is exactly the same command as add user, please refer to the command mentioned above.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务