Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Break changes:
不再以 root 权限运行:如果你出于任何理由不得不以 root 权限运行(大部分用户不需要,也不建议这么做)
可以加参数恢复 root 权限,
docker run -d --user root
其它情况比如要监听 < 1024 端口,你应该用容器标准做法:外部映射小端口,内部改用大端口
docker run -d -p 443:8443
如果你希望得到 udp fullcone 而不得不用 host 网络,你应该 cap net 特权,而不是用 root 用户
配置文件路径变更:需要注意配置文件权限,默认创建好的文件权限是对的,你可以参考它们的值
限制了日志文件权限,如果你使用非默认日志文件路径,你必须保证容器内的 uid 65532 可写
-ls
后缀的标签没了,也没啥人用,现在默认已是 ls 的 geodata,如果你之前用-ls
现在应该删掉Example:
或者,你也可以在宿主找一个空的目录,这样实例首次启动时会自动创建空的配置文件,并自动处理好文件和目录的权限
注意:如果你的 docker 引擎配了 uidremap,那么你在给宿主目录和文件配权限的时候还得处理映射关系
因此最佳实践是:找个空目录先启动一次,完了再直接 echo 配置到现有的文件上,这可以省掉很多麻烦
解决了现有 docker 映像的这些问题:
改成仅 release 时 build image
改成多文件,处理目录和文件权限以支持 nonroot
docker.yml
有许多参数相互冲突,比如最开头规定只在main
分支改动和release
时运行,但下面又定义 PR 也可运行删掉无用的,改为仅 release
改成UTC,因为不只是中国人在用,而且服务器大多在非中国
改为默认写 error,自动创建卷来持久化,处理目录和文件权限以支持 nonroot
xray-install
脚本不一致改为一样的
chainguard/stable:amd64
,实际上是应该分 arch 的,虽然里面这种 image 没有 ELF,但不清楚会有什么不好影响,这毕竟是非标准做法考虑到 chainguard 支持的架构不如
google distroless
多,因此改用后者,并且现在支持更多架构改成 loyalsoldier,因此 没有
-ls
标签了所以换成
golang:latest
,有需要的话也可以指定版本,以前是指定的,为啥 @yuhan6665 改为 latest 了支持的架构: