lanthora / candy

A reliable, low-latency, and anti-censorship virtual private network
https://docs.canets.org
MIT License
461 stars 56 forks source link

docker部署candy,配置文件放在哪里 #445

Closed jimmycart888 closed 1 month ago

jimmycart888 commented 1 month ago

docker部署candy,配置文件放在哪里? docker run --detach --privileged=true --net=host --volume /var/lib/candy:/var/lib/candy docker.io/lanthora/candy:latest -c /var/lib/candy/candy.cfg 上面这个是否正确?

peeweep commented 1 month ago

https://github.com/lanthora/candy/blob/fbc05072fe71dc736e34329333de714a3b0b280c/dockerfile#L15C1-L15C29 挂载 ./candy.cfg:/etc/candy.cfg,不需要 -c /var/lib/candy/candy.cfg

jimmycart888 commented 1 month ago

docker run \ --network=host \ --privileged=true \ -v /var/lib/candy:/var/lib/candy \ -v /var/lib/candy/candy.cfg:/etc/candy.cfg \ --restart always \ --name candy \ -d docker.io/lanthora/candy:latest

candy.cfg文件已经放到/var/lib/candy中了

我运行上面的,显示docker一直在重启,错误信息如下: llds:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3a02a1bbed20 lanthora/candy:latest "/usr/bin/candy -c /…" 8 seconds ago Restarting (1) Less than a second ago candy

配置文件信息如下: mode = "client" websocket = "wss://canets.org/xxx/" password = "xxx" stun = "stun://stun.canets.org" discovery = 300 route = 5

lanthora commented 1 month ago

@jimmycart888 要拿到进程产生的日志,这些信息没法判断出错的原因

lanthora commented 1 month ago

@jimmycart888 去掉 docker 命令中的 -d 参数,可以看到进程内部的日志

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 3 days since being marked as stale.