Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot reload 在 docker 中是不是无效 #200

Closed
xspio opened this issue Nov 2, 2022 · 8 comments
Closed

hot reload 在 docker 中是不是无效 #200

xspio opened this issue Nov 2, 2022 · 8 comments

Comments

@xspio
Copy link

xspio commented Nov 2, 2022

运行 docker run -it --rm -v "path/to/config.toml:/app/config.toml" rathole --server /app/config.toml
然后修改 path/to/config.toml,但是并没有触发 reload,只有重启上面运行的 container 才生效
是哪里没有配置好吗?

@rapiz1
Copy link
Owner

rapiz1 commented Nov 2, 2022 via email

@xspio
Copy link
Author

xspio commented Nov 2, 2022

以后会考虑在 rapiz1/rathole 镜像中加入 inotify-tools 吗

@rapiz1
Copy link
Owner

rapiz1 commented Nov 2, 2022

你确认过这样可以解决问题吗?我没有调查过。如果可以修复,可以加入镜像

@xspio
Copy link
Author

xspio commented Nov 2, 2022

尝试生成镜像来测试,不过报下面错误,怎么解决

Updating crates.io index
error: failed to select a version for the requirement `libgit2-sys = "^0.14.0"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.15.0`

@rapiz1
Copy link
Owner

rapiz1 commented Nov 2, 2022

@xspio
Copy link
Author

xspio commented Nov 3, 2022

Dockerfile 可以了,不幸的是在镜像中加入 inotify-tools 并启动服务后还是无法 hot reload

@rapiz1
Copy link
Owner

rapiz1 commented Nov 5, 2022

应该是 docker 阻碍了 inotify 事件的传递
https://twitter.com/dr4goonis/status/950464956650094599?lang=en 可以尝试一下这里提到的解决方案,docker里volume指定一个目录。

@xspio
Copy link
Author

xspio commented Nov 5, 2022

按照上面说的,映射了整个文件夹,然后就生效了,太棒了

@rapiz1 rapiz1 closed this as completed Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants