v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.28k stars 8.94k forks source link

v2ray的docker怎么用? #318

Closed testcaoy7 closed 7 years ago

testcaoy7 commented 7 years ago

我想把镜像内的config.json换成自己的,应该怎么操作呀?

l-we commented 7 years ago

自己通过 Dockerfile 构造

ADD config.json v2ray/config.json

v2ray commented 7 years ago

v2ray/official 和 v2ray/dev 镜像内的配置文件均位于 /etc/v2ray/config.json

你可以像 @kxjhlele 所说的那样自己写一个 dockerfiler,编译的时候把你的配置文件复制进去。或者使用 docker 的指令 docker cp 来修改一个已下载的镜像文件,详见文档

tetsuhou commented 6 years ago

忽然想起来这个issue, 以前帮了我很大的忙, 不过现在有另一个解决方案, 是通过像下面这样的docker run选项来解决 --mount type=bind,source=你自己的config.json,target=/etc/v2ray/config.json 详细的信息可以看Docker — 从入门到实践/挂载主机目录