Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Watch: exec mode

未关闭
#14,326 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@glours 已经在做这个了。

开始于 2026年10月12日。

评估

这个 Issue 还没有评估数据。

描述

kind/feature
Description

In https://github.com/docker/compose/pull/12330, sync+exec mode was introduced as a watch action.

I would like to request an additional action that only performs the exec part, without syncing any files.

Use case

My application code is bind-mounted into the container using volumes. On files changes I don't need the files copied in, as the volume mount already takes care of that, only a command run inside the container: here, rr reset to restart the RoadRunner workers, which is much faster than restarting the whole container.

sync+exec is the only action that runs a command, so I use it at the moment. But syncing into the bind-mounted path writes the files back onto the host (with the container user's ownership and second-precision timestamps). The watcher sees its own write as a new change and syncs again, so it loops every second.

My current workaround is to sync into a throwaway path inside the container just to trigger the exec:

develop:
  watch:
    - action: sync+exec
      path: ./src
      target: /tmp/src-watch   # throwaway; ./src is already bind-mounted at /code/src
      exec:
        command: rr reset http

This avoids triggering the endless loop described above.

Proposal

An exec action that runs the exec command on a change and takes no target:

develop:
  watch:
    - action: exec
      path: ./src
      exec:
        command: rr reset http

Thank you!

Related:
主要语言
Go
星标
38.5k
派生
5.9k
平均合并
1 天 17 小时
30 天内合并 PR
63

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/compose 的其他 Issue

查看 docker/compose 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。