标签: 开发运维

3 个内容

笔记(3)

Docker Compose可通过`profiles`配置控制服务是否默认启动。在Compose v3.9+中,未指定profile的服务默认启动,指定profile的服务需通过`docker compose --profile <profile_name> up` 显式启动。该方法可以灵活控制compose文件中部分服务的启动与停止。

Elliot Yang·
59 浏览

Docker Compose文件中定义多服务时,选择性启动是常见需求。本文介绍了四种方法:直接指定服务名、使用profiles分组、override文件或环境变量修改启动行为、以及过滤服务名启动。推荐使用profiles进行分组管理。

Elliot Yang·
245 浏览

解决 `fatal: early EOF fatal: index-pack failed` 错误,可尝试关闭全局压缩:`git config --global core.compression 0`。此操作会使磁盘和网络传输变慢。可通过浅克隆 `git clone --depth 1 <repo_URI>` 后 `git fetch --unshallow` 替代。`git gc` 清理仓库,`core.compression` 默认值为 2,0 为不压缩。

Elliot Yang·
156 浏览