Code Monkey home page Code Monkey logo

docker's People

Contributors

attarchi avatar chisaato avatar cloudwindy avatar kslr avatar loyalsoldier avatar mzz2017 avatar onqiaujliu avatar raidenii avatar vcptr avatar weaving118 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

请求帮助,想使用docker compose创建但是报错。

使用docker run可以运行,但compose可以修改端口等配置信息,很方便,所以还是想用compose,但是报错。

# docker run -d --name v2ray -v $PWD/config.json:/etc/v2fly/config.json -v $PWD/ca:/etc/v2fly/ca -p 443:443 v2fly/v2fly-core run -c /etc/v2fly/config.json
# docker-compose.yaml

version: '3.9'

services:
  v2ray:
    image: v2fly/v2fly-core
    container_name: v2ray
    restart: unless-stopped
    ports:
      - '443:443'
    volumes:
      - $PWD/config.json:/etc/v2fly/config.json
      - $PWD/ca:/etc/v2fly/ca/
      - $PWD/logs:/etc/v2fly/logs/
    command:
      - /usr/bin/v2ray run -c /etc/v2fly/config.json
{
  "log": {
    "loglevel": "error",
    "access": "/etc/v2fly/logs/access.log",
    "error": "/etc/v2fly/logs/error.log"
  },
  "inbounds": [
    {
      "port": 443,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "xxxxxxxxxxxx",
            "level": 0,
            "alterId": 0,
            "email": "[email protected]"
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "tls",
        "tlsSettings": {
          "certificates": [
            {
              "certificateFile": "/etc/v2fly/ca/server.cer",
              "keyFile": "/etc/v2fly/ca/server.key"
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

container 不能正常启动。
docker logs 报错信息:

v2ray /usr/bin/v2ray run -c /etc/v2fly/config.json: unknown command
Run 'v2ray help /usr/bin/v2ray run -c' for usage.

尝试过修改command,v2ray help都不能正常打印。

创建docker容器报错

目前创建的命令是这样
docker run --name v2ray -v /etc/v2ray/config.json:/etc/v2ray/config.json:ro v2fly/v2fly-core

日志返回是
020-09-28T16:37:36.708822233Z V2Ray v4.29.0 (v2fly/155c0e07) dockerfly-amd64 (go1.15.2 linux/amd64)
2020-09-28T16:37:36.708852121Z A unified platform for anti-censorship.
2020-09-28T16:37:36.818175991Z 2020/09/28 16:37:36 [Info] v2ray.com/core/common/platform/ctlcmd:
2020-09-28T16:37:36.818204735Z v2ctl> Read config: /etc/v2ray/config.json
2020-09-28T16:37:36.905166281Z 2020/09/28 16:37:36 [Warning] v2ray.com/core: V2Ray v4.29.0 started

就...没太看出来哪有问题。这个docker接入有具体的教程么orz果然是用docker搭的人太少了吗

Base Config

Can someone send me base config which I will modify and link to etc/v2ray/config
It can be vmess or vless and incomming connection will be from '80' port

  • It will be helpful if someone can also send uid generator site to fill in its config

用来做客户端不行噢,能帮我看看那里有问题吗?

config.json 我抄
https://github.com/v2fly/v2ray-examples/blob/master/VLESS-TCP-TLS%20(maximal%20by%20rprx)/config_client.json
替换了下面该替换的地方

     {
         "log": {
                       "loglevel": "warning"
                 },
        "inbounds": [
              {
                "port": 10800,
                "listen": "127.0.0.1",
                "protocol": "socks",
                "settings": {
                "udp": true
              }
          }
        ],
           "outbounds": [
           {
              "protocol": "vless",
              "settings": {
               "vnext": [
                  {
                      "address": "example.com", // 换成你的域名或服务器 IP(发起请求时无需解析域名了)
                      "port": 443,
                      "users": [
                          {
                              "id": "", // 填写你的 UUID
                              "encryption": "none",
                              "level": 0
                          }
                      ]
                  }
              ]
          },
          "streamSettings": {
              "network": "tcp",
               "security": "tls",
               "tlsSettings": {
                   "serverName": "example.com" // 换成你的域名
              }
          }
         }
     ]
  }

然后
docker run -d --name v2ray --network host -v /etc/v2ray/config.json:/etc/v2ray/config.json v2fly/v2fly-core
不知道为什么不行

带宽占用过高

配置是这个:
{
"log": {
"loglevel": "warning"
},
"inbound": {
"port": 1080,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
...
]
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/v1"
}
}
}
}

这个配置是按照网上的教程弄的,不是很理解这些配置的含义,docker run 之后,带宽流量蹭蹭蹭多了1M多,请问这个正常吗

尝试构建 docker 失败

操作如下:

$ git clone https://github.com/v2fly/docker.git
$ cd v2fly
$ sudo docker build -t v2fly .

但失败了, 请问应该如何构建这个 docker? 谢谢.

logs:

$ sudo docker build -t v2fly .

[+] Building 2.2s (8/8) FINISHED                                                                         docker:default
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 638B                                                                               0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                   0.3s
 => [1/4] FROM docker.io/library/alpine:latest@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac3403  0.0s
 => [internal] load build context                                                                                  0.0s
 => => transferring context: 30B                                                                                   0.0s
 => CACHED [2/4] WORKDIR /tmp                                                                                      0.0s
 => CACHED [3/4] COPY v2ray.sh /v2ray.sh                                                                           0.0s
 => ERROR [4/4] RUN set -ex     && apk add --no-cache ca-certificates     && mkdir -p /etc/v2ray /usr/local/share  1.8s
------                                                                                                                  
 > [4/4] RUN set -ex     && apk add --no-cache ca-certificates     && mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray     && ln -sf /dev/stdout /var/log/v2ray/access.log     && ln -sf /dev/stderr /var/log/v2ray/error.log     && chmod +x "${WORKDIR}"/v2ray.sh     && "${WORKDIR}"/v2ray.sh "linux/amd64" "${TAG}":                                       
0.319 + apk add --no-cache ca-certificates                                                                              
0.323 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz                                     
0.618 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
0.846 (1/1) Installing ca-certificates (20230506-r0)
0.878 Executing busybox-1.36.1-r15.trigger
0.882 Executing ca-certificates-20230506-r0.trigger
0.912 OK: 8 MiB in 16 packages
0.964 + mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray
0.965 + ln -sf /dev/stdout /var/log/v2ray/access.log
0.966 + ln -sf /dev/stderr /var/log/v2ray/error.log
0.966 + chmod +x /v2ray.sh
0.967 + /v2ray.sh linux/amd64 
0.967 Downloading binary file: v2ray-linux-64.zip
0.967 Downloading binary file: v2ray-linux-64.zip.dgst
1.691 Error: Failed to download binary file: v2ray-linux-64.zip v2ray-linux-64.zip.dgst
------
Dockerfile:9
--------------------
   8 |     
   9 | >>> RUN set -ex \
  10 | >>>     && apk add --no-cache ca-certificates \
  11 | >>>     && mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray \
  12 | >>>     # forward request and error logs to docker log collector
  13 | >>>     && ln -sf /dev/stdout /var/log/v2ray/access.log \
  14 | >>>     && ln -sf /dev/stderr /var/log/v2ray/error.log \
  15 | >>>     && chmod +x "${WORKDIR}"/v2ray.sh \
  16 | >>>     && "${WORKDIR}"/v2ray.sh "${TARGETPLATFORM}" "${TAG}"
  17 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c set -ex     && apk add --no-cache ca-certificates     && mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray     && ln -sf /dev/stdout /var/log/v2ray/access.log     && ln -sf /dev/stderr /var/log/v2ray/error.log     && chmod +x \"${WORKDIR}\"/v2ray.sh     && \"${WORKDIR}\"/v2ray.sh \"${TARGETPLATFORM}\" \"${TAG}\"" did not complete successfully: exit code: 1

请求更新4.29.0

昨晚更新的latest是4.28.2...看到昨天4.29.0已经出来了,希望作者能更新,非常期待试试xtls,谢谢!

Outdated in Dockerhub

Latest version in Dockerhub is still 4.37.3, which is outdated.
Any plan to update them?

容器部署无法代理,但直接在宿主机部署可以

我是当客户端代理的。
我用的启动命令
sudo docker run -d --name v2ray -v ./config.json:/etc/v2fly/config.json -p 1080:1080 v2fly/v2fly-core run -c /etc/v2fly/config.json

config如下

{
  "log": {
    "access": "/app/logs/v2ray-access.log",
    "error": "/app/logs/v2ray-error.log",
    "loglevel": "info"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "protocol": "socks",
      "settings": {
        "udp": false,
        "auth": "noauth"
      },
      "port": "1080"
    },
    {
      "listen": "127.0.0.1",
      "protocol": "http",
      "settings": {
        "timeout": 360
      },
      "port": "1087"
    }
  ],
  "outbounds": [
    {
      "mux": {
        "enabled": false,
        "concurrency": 8
      },
      "protocol": "vmess",
      "streamSettings": {
        "network": "tcp",
        "tcpSettings": {
          "header": {
            "type": "none"
          }
        },
        "security": "none"
      },
      "tag": "proxy",
      "settings": {
        "vnext": [
          {
            "address": "xx.xx.xx.xx",
            "users": [
              {
                "id": "a559a39f-3943-44cb-9283-531a5e1d50ef",
                "alterId": 0,
                "level": 0,
                "security": "aes-128-gcm"
              }
            ],
            "port": 49171
          }
        ]
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIP",
        "userLevel": 0
      }
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "none"
        }
      }
    }
  ],
  "dns": {},
  "routing": {
    "settings": {
      "domainStrategy": "AsIs",
      "rules": []
    }
  },
  "transport": {}
}

sudo docker ps如下

CONTAINER ID   IMAGE                               COMMAND                  CREATED          STATUS          PORTS                                                 NAMES
a02a9c97485a   v2fly/v2fly-core                    "/usr/bin/v2ray run …"   23 seconds ago   Up 22 seconds   0.0.0.0:1080->1080/tcp, :::1080->1080/tcp             v2ray

代码如下

package main

import (
	"fmt"
	"golang.org/x/net/proxy"
	"io/ioutil"
	"net/http"
)

func NewSocksDialer(addr string) (proxy.Dialer, error) {
	return proxy.SOCKS5("tcp", addr, nil, proxy.Direct)
}
func main() {
	dialer, err := NewSocksDialer("127.0.0.1:1080")
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	// create a socks5 dialer

	// setup a http client
	httpTransport := &http.Transport{Dial: dialer.Dial}
	httpClient := &http.Client{Transport: httpTransport}
	// set our socks5 as the dialer

	if resp, err := httpClient.Get("https://www.google.com"); err != nil {
		fmt.Println(err.Error())
		return
	} else {
		defer resp.Body.Close()
		if bs, err := ioutil.ReadAll(resp.Body); err == nil {
			fmt.Println(string(bs))
		} else {
			fmt.Println(err.Error())
		}
	}
}

报错
Get "https://www.google.com": socks connect tcp 127.0.0.1:1080->www.google.com:443: read tcp 127.0.0.1:34442->127.0.0.1:1080: read: connection reset by peer

完全一样的配置,在宿主机直接起进程,就正常。

Docker 版连接速度和稳定性明显弱于普通安装版本

一周前安装了 Docker 版的 v2r server,观察到这样的现象:

一台国外主机,同时部署了 Docker 版本和普通安装版本,发现 Docker 版明显速度慢(我没有做定量的 benchmark,但是肉眼可见地变慢了)且不稳定(经常性刷不出来页面),切换到普通安装版本立马恢复正常。
二者使用了不同的端口和 id,应该不会发生冲突。
另外,使用多个城市的宽带和手机 4G 都发现了上述问题,因此大概率不是网络原因。

所以,请教一下是什么原因导致的?

还需要提供些什么 debug 信息,以便你们团队追查问题(如果真的是 Docker 版问题的话)?

docker-compose 启动时提示 unknown command

按照 #46 修改后还是返回该错误,docker run 启动时正常

proxy | v2ray run -c /etc/v2ray/config.json: unknown command
proxy | Run 'v2ray help run -c' for usage.

container_name: proxy
image: v2fly/v2fly-core:v5.1.0
volumes:
  - $PWD/v2ray-config.json:/etc/v2ray/config.json
command:
  - "run -c /etc/v2ray/config.json"

Allow container to run as non root

Hi,

Please allow the container to run as non root user. The current Dockerfile WORKDIR /root prevents even --user arg when running the container as non root. Changing it to WORKDIR /tmp still builds the image successfully. Happy to submit a PR for that (and also remove dependency on openssl - for verifying the digest file, alpine image comes with sha512sum).

Also, is there a particular reason that this container need to run as root? By default, to bind port > 1024, any process can do, and /dev/shm is open for all for domain sockets. Even when the container needs to bind at port 443 on host, it can still be done via docker-proxy to redirect the port binding, and use high ports inside the container.

没有建立/var/log/v2ray目录

应该在代码中增加
mkdir -p /var/log/v2ray

RUN apk update && apk add ca-certificates && \
    mkdir -p /usr/bin/v2ray && \
    mkdir -p /var/log/v2ray && \
    tar xvfz /tmp/v2ray.tgz -C /usr/bin/v2ray

unnamed volume

每次docker-compose up -d && docker-compose down会产生一个随机volume

docker-compose.yml

version: '3.8'
services:
proxy:
image: v2fly/v2fly-core
volumes:
- ./config/client.json:/etc/v2ray/config.json:ro
ports:
- "127.0.0.1:10800:10800"

the latest container build is with security vulnerabilities

The current latest image of v2fly-core is with plenty of security vulnerabilities, on alpine 3.17.1, and v2ray 5.2.1.

image

upgrading to alpine 3.18 and v2ray 5.4.1 would clear up the vulnerabilities

image

As in this repo, it's just using the "latest" tag to build the image, pls help retrigger the build in some way to make the latest image up to date.

Thanks!

是否有必要将v2ray的日志转发给docker日志收集器

在nginx的Dockerfile里有如下两行

# forward request and error logs to docker log collector
    && ln -sf /dev/stdout /var/log/nginx/access.log \
    && ln -sf /dev/stderr /var/log/nginx/error.log \

它将日志文件连接到标准输出中,这样可以在使用docker logs时能够打印nginx的日志

v2ray有必要将日志连接到标准输出吗? 例如:

FROM --platform=${TARGETPLATFORM} alpine:latest
LABEL maintainer="V2Fly Community <[email protected]>"

WORKDIR /root
ARG TARGETPLATFORM
ARG TAG
COPY v2ray.sh /root/v2ray.sh

RUN set -ex \
	&& apk add --no-cache tzdata openssl ca-certificates \
	&& mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray \
	&& chmod +x /root/v2ray.sh \
        # forward request and error logs to docker log collector
        && ln -sf /dev/stdout /var/log/v2ray/access.log \
        && ln -sf /dev/stderr /var/log/v2ray/error.log \
	&& /root/v2ray.sh "${TARGETPLATFORM}" "${TAG}"

ENTRYPOINT ["/usr/bin/v2ray"]

技术方案来源:
https://serverfault.com/questions/599103/make-a-docker-application-write-to-stdout
https://github.com/nginxinc/docker-nginx/blob/5ce65c3efd395ee2d82d32670f233140e92dba99/mainline/debian/Dockerfile

Cannot start docker

I get the following error message:

$ docker logs v2ray
V2Ray 4.22.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.13.5 linux/amd64)
A unified platform for anti-censorship.
main: failed to create server > v2ray.com/core/app/log: failed to initialize access logger > open /var/folders/bk/5d1vvhsn1h7fjv4_blhxvpgm0000gn/T/cenmrev.v2rayx.log/access.log: no such file or directory

too many files open

Hi,
Please help me. I am getting this error.
How to fix it with Docker
I want many people to access my server.

Screenshot 2022-11-25 203134

No geoip In the latest build

When using geoip in conf file, the following error is shown:
v2ray_1 | V2Ray v4.22.1-124-g13b309f1 (v4.22.1-124-g13b309f1) docker-fly-amd64 (go1.13.9 linux/amd64)
v2ray_1 | A unified platform for anti-censorship.
v2ray_1 | main: failed to read config files: [/etc/v2ray/config.json] > v2ray.com/core/main/json: failed to execute v2ctl to convert config file. > v2ray.com/core/common/platform/ctlcmd: failed to execute v2ctl:
v2ray_1 | v2ctl> Read config: /etc/v2ray/config.json
v2ray_1 | v2ray.com/core/infra/conf: invalid field rule > v2ray.com/core/infra/conf: failed to load GeoIP: private > proto: can't skip unknown wire type 7 > exit status 255

And when I change back to v4.22.1, everything works fine.

I've tried to add geoip into /usr/local by setting -v in the docker run command, but it doesn't work.

容器启动错误求助

#12

使用该issue中提出的启动命令:

docker run \
 -d \
 --cap-add=NET_ADMIN \
 --restart=always \
 --network host \
 -e V2RAY_LOCATION_CONFIG=/etc/v2ray \
 -e V2RAY_LOCATION_ASSET=/etc/v2ray \
 -e V2RAY_BUF_READV=enable \
 -v /etc/v2ray:/etc/v2ray \
 -v /var/log/v2ray:/var/log \
 --name v2ray \
 v2fly/v2fly-core

启动后检查docker ps -a发现容器在无限重启,请问应如何修正

wrong config path in readme file

In readme file line:

docker run ..... -v /path/to/config.json:/etc/v2fly/config.json .....

bind config path is wrong. I check it inside container and
/etc/v2fly/config.json
should change to
/etc/v2ray/config.json

failed to set SO_MARK > operation not permitted

日志中出现了一些 operation not permitted 的内容, 不知道 docker 里有没有CAP_NET_ADMIN这种能力? 该怎么解决呢

2020/07/06 17:21:51 [Info] [2754594387] v2ray.com/core/transport/internet: failed to apply socket options > v2ray.com/core/transport/internet: failed to set SO_MARK > operation not permitted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.