docker安装v2ray
docker安装v2ray

docker安装v2ray

获取镜像

docker pull mzz2017/v2raya

运行

停止正在运行的版本(如果存在):

docker container stop v2raya docker container rm v2raya


# run v2raya
docker run -d \
  --restart=always \
  --privileged \
  --network=host \
  --name v2raya \
  -e V2RAYA_LOG_FILE=/tmp/v2raya.log \
  -v /lib/modules:/lib/modules:ro \
  -v /etc/resolv.conf:/etc/resolv.conf \
  -v /etc/v2raya:/etc/v2raya \
  mzz2017/v2raya

如果你使用 MacOSX 或其他不支持 host 模式的环境,在该情况下无法使用全局透明代理,或者你不希望使用全局透明代理,docker 命令会略有不同:


<span class="hljs-comment" style="box-sizing: border-box; color: rgb(136, 136, 136); font-family: sfmono-regular, menlo, monaco, consolas, &quot;Liberation Mono&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; text-wrap: nowrap;"># run v2raya</span><span style="color: rgb(29, 45, 53); font-family: sfmono-regular, menlo, monaco, consolas, &quot;Liberation Mono&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; text-wrap: nowrap; background-color: rgb(251, 247, 240);">
docker run -d \
  -p 2017:2017 \
  -p 20170-20172:20170-20172 \
  --restart=always \
  --name v2raya \
  -e V2RAYA_LOG_FILE=/tmp/v2raya.log \
  -v /etc/v2raya:/etc/v2raya \
  mzz2017/v2raya</span>

查看状态:

docker container stats v2raya

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注