mritd / dockerfile

some personally made dockerfile
https://hub.docker.com/u/mritd
MIT License
2.08k stars 649 forks source link

使用自定的v2ray config 失败 #36

Closed alexya closed 6 years ago

alexya commented 6 years ago

我试了一下 使用下面的命令,启动起来的v2ray container 可以正常运行。

docker run -dt --name v2ray mritd/v2ray

可是下面的命令,尝试使用自定义的设置(这句话是直接copy @mritd readme里面的那句),container可以创建出来,但是会迅速stop掉。不清楚哪里有问题?

docker run -dt --name v2ray mritd/v2ray -c "{\"log\" : {     \"access\": \"/var/log/v2ray/access.log\",     \"error\": \"/var/log/v2ray/error.log\",     \"loglevel\": \"warning\"   },   \"inbound\": {     \"port\": 4500,     \"protocol\": \"vmess\",     \"settings\": {       \"clients\": [         {           \"id\": \"23ad6b10-8d1a-40f7-8ad0-e3e35cd38297\",           \"level\": 1,           \"alterId\": 64         }       ]     }   },   \"outbound\": {     \"protocol\": \"freedom\",     \"settings\": {}   },   \"outboundDetour\": [     {       \"protocol\": \"blackhole\",       \"settings\": {},       \"tag\": \"blocked\"     }   ], \"routing\": {     \"strategy\": \"rules\",     \"settings\": {       \"rules\": [         {           \"type\": \"field\",           \"ip\": [             \"0.0.0.0/8\",             \"10.0.0.0/8\",             \"100.64.0.0/10\",             \"127.0.0.0/8\",             \"169.254.0.0/16\",             \"172.16.0.0/12\",             \"192.0.0.0/24\",             \"192.0.2.0/24\",             \"192.168.0.0/16\",             \"198.18.0.0/15\",             \"198.51.100.0/24\",             \"203.0.113.0/24\",             \"::1/128\",             \"fc00::/7\",             \"fe80::/10\"           ],           \"outboundTag\": \"blocked\"         }       ]     }   },   \"transport\": {     \"kcpSettings\": {       \"uplinkCapacity\": 10,       \"downlinkCapacity\": 10     }   } }"

image

update:

  1. 为了排除虚拟机的问题,我又重新创建了两台虚拟机(16G内存,8核),container依然无法正常工作。
  2. 然后,我把v2ray/official里面的json倒出来,格式化后,按照上面的自定义方法,也无法工作。 e.g.
    docker run -dt --name v2ray -p 8389:8389 mritd/v2ray -c "{\"log\":{\"access\":\"/var/log/v2ray/access.log\",\"error\":\"/var/log/v2ray/error.log\",\"loglevel\":\"warning\"},\"inbound\":{\"port\":10086,\"protocol\":\"vmess\",\"settings\":{\"clients\":[{\"id\":\"23ad6b10-8d1a-40f7-8ad0-e3e35cd38297\",\"level\":1,\"alterId\":64}]}},\"outbound\":{\"protocol\":\"freedom\",\"settings\":{}},\"outboundDetour\":[{\"protocol\":\"blackhole\",\"settings\":{},\"tag\":\"blocked\"}],\"routing\":{\"strategy\":\"rules\",\"settings\":{\"rules\":[{\"type\":\"field\",\"ip\":[\"0.0.0.0/8\",\"10.0.0.0/8\",\"100.64.0.0/10\",\"127.0.0.0/8\",\"169.254.0.0/16\",\"172.16.0.0/12\",\"192.0.0.0/24\",\"192.0.2.0/24\",\"192.168.0.0/16\",\"198.18.0.0/15\",\"198.51.100.0/24\",\"203.0.113.0/24\",\"::1/128\",\"fc00::/7\",\"fe80::/10\"],\"outboundTag\":\"blocked\"}]}}}"
alexya commented 6 years ago

I replaced the default config.json and build an image by myself.