[GH-ISSUE #529] 在docker里运行无法穿透 #410

Closed
opened 2026-05-05 12:13:45 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @dxvgef on GitHub (Nov 18, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/529

What version of frp are you using (./frpc -v or ./frps -v)?
0.9.3

What operating system and processor architecture are you using (go env)?
darwin/amd64

Configures you used:
我在docker里以桥接模式的网络运行frp client,fpr server在远程服务器上运行正常,这是我的客户端配置文件,用这个配置能连上远程服务器(见下图的打印)
[privilege_web]
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 10088
use_gzip = false
subdomain = test

Steps to reproduce the issue:

  1. 用docker run -p 10088:10088 把容器中的10088端口映射到了宿主机的10088端口;
    2.如果宿主机的10088端口的进程正在运行,会无法映射;
    3.关闭宿主机的10088端口的进程后能映射成功,然后再启动10088端口的进程,但在进行穿透连接时容器里的frp client报错:
    image

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @dxvgef on GitHub (Nov 18, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/529 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.9.3 **What operating system and processor architecture are you using (`go env`)?** darwin/amd64 **Configures you used:** 我在docker里以桥接模式的网络运行frp client,fpr server在远程服务器上运行正常,这是我的客户端配置文件,用这个配置能连上远程服务器(见下图的打印) [privilege_web] privilege_mode = true type = http local_ip = 127.0.0.1 local_port = 10088 use_gzip = false subdomain = test **Steps to reproduce the issue:** 1. 用docker run -p 10088:10088 把容器中的10088端口映射到了宿主机的10088端口; 2.如果宿主机的10088端口的进程正在运行,会无法映射; 3.关闭宿主机的10088端口的进程后能映射成功,然后再启动10088端口的进程,但在进行穿透连接时容器里的frp client报错: ![image](https://user-images.githubusercontent.com/5192264/32982239-c8fe41e6-cc46-11e7-9b7b-4fa4e8a111bd.png) **Describe the results you received:** **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner

@fatedier commented on GitHub (Nov 19, 2017):

这类问题你需要查阅 docker 相关的资料解决。

<!-- gh-comment-id:345525795 --> @fatedier commented on GitHub (Nov 19, 2017): 这类问题你需要查阅 docker 相关的资料解决。
Author
Owner

@tolbkni commented on GitHub (Nov 20, 2017):

@dxvgef 你搞反了,你要的不是容器中的10088端口映射到宿主机的10088端口,而是宿主机中的10088端口映射到容器的10088端口。

<!-- gh-comment-id:345635365 --> @tolbkni commented on GitHub (Nov 20, 2017): @dxvgef 你搞反了,你要的不是容器中的10088端口映射到宿主机的10088端口,而是宿主机中的10088端口映射到容器的10088端口。
Author
Owner

@dxvgef commented on GitHub (Nov 20, 2017):

那应该怎么设置?


From: Gao Jiangmiao notifications@github.com
Sent: Monday, November 20, 2017 5:16:01 PM
To: fatedier/frp
Cc: dxvgef; Mention
Subject: Re: [fatedier/frp] 在docker里运行无法穿透 (#529)

@dxvgefhttps://github.com/dxvgef 你搞反了,你要的不是容器中的10088端口映射到宿主机的10088端口,而是宿主机中的10088端口映射到容器的10088端口。


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/fatedier/frp/issues/529#issuecomment-345635365, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE86SO1n3SdyNs4YCxyPK0-IlcgWAwcVks5s4UNQgaJpZM4QjC_j.

<!-- gh-comment-id:345775013 --> @dxvgef commented on GitHub (Nov 20, 2017): 那应该怎么设置? ________________________________ From: Gao Jiangmiao <notifications@github.com> Sent: Monday, November 20, 2017 5:16:01 PM To: fatedier/frp Cc: dxvgef; Mention Subject: Re: [fatedier/frp] 在docker里运行无法穿透 (#529) @dxvgef<https://github.com/dxvgef> 你搞反了,你要的不是容器中的10088端口映射到宿主机的10088端口,而是宿主机中的10088端口映射到容器的10088端口。 ― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/fatedier/frp/issues/529#issuecomment-345635365>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AE86SO1n3SdyNs4YCxyPK0-IlcgWAwcVks5s4UNQgaJpZM4QjC_j>.
Author
Owner

@tolbkni commented on GitHub (Nov 21, 2017):

找出 docker 网络中 host 的 IP,一般是 docker0 的那个,直接访问 docker0 的 IP:10088 即可

<!-- gh-comment-id:345889172 --> @tolbkni commented on GitHub (Nov 21, 2017): 找出 docker 网络中 host 的 IP,一般是 docker0 的那个,直接访问 docker0 的 IP:10088 即可
Author
Owner

@dxvgef commented on GitHub (Dec 7, 2017):

@tolbkni 知道了,谢谢

<!-- gh-comment-id:349931946 --> @dxvgef commented on GitHub (Dec 7, 2017): @tolbkni 知道了,谢谢
Author
Owner

@xiaozefeng commented on GitHub (Jul 18, 2018):

是镜像的问题,你别用alpine镜像,用ubuntu作为基础镜像即可解决
https://github.com/xiaozefeng/frp-docker

<!-- gh-comment-id:405780856 --> @xiaozefeng commented on GitHub (Jul 18, 2018): 是镜像的问题,你别用alpine镜像,用ubuntu作为基础镜像即可解决 https://github.com/xiaozefeng/frp-docker
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#410
No description provided.