[GH-ISSUE #255] Dockerfile_alpine不能正常使用 #180

Closed
opened 2026-05-05 11:55:48 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @alwaystest on GitHub (Feb 15, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/255

在go环境下编译好binary后build的Docker_alpine容器不能正常运行。

报错 no such file or directory

StackOverflow给出的解决方案在这里 http://stackoverflow.com/a/36308464/3819519

There are two solutions I've come across:

  • Disable CGO, via CGO_ENABLED=0
  • Force the use of the Go implementation of net dependencies, netgo via go build -tags netgo -a -v, this is implemented for a certain platforms

我使用了第一种方法,编译的二进制文件可以正常运行。

Originally created by @alwaystest on GitHub (Feb 15, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/255 在go环境下编译好binary后build的Docker_alpine容器不能正常运行。 报错 `no such file or directory` StackOverflow给出的解决方案在这里 http://stackoverflow.com/a/36308464/3819519 > There are two solutions I've come across: > - Disable CGO, via CGO_ENABLED=0 > - Force the use of the Go implementation of net dependencies, netgo via go build -tags netgo -a -v, this is implemented for a certain platforms 我使用了第一种方法,编译的二进制文件可以正常运行。
Author
Owner

@fatedier commented on GitHub (Feb 15, 2017):

了解,这个 Dockefile 不涉及编译,只是把你编好的文件放进去,编译时需要注意。

<!-- gh-comment-id:280016784 --> @fatedier commented on GitHub (Feb 15, 2017): 了解,这个 Dockefile 不涉及编译,只是把你编好的文件放进去,编译时需要注意。
Author
Owner

@alwaystest commented on GitHub (Feb 16, 2017):

所以Makefile.cross-compiles文件是不是需要更新一下?免得别人在用alpine镜像运行的时候再出问题。相对golang镜像,alpine镜像的大小真的小好多,我想大家如果用Docker来跑frps的时候应该都会倾向选择alpine镜像吧。

我对go语言不熟悉,不知道CGO_ENABLED=0会不会有什么别的副作用,所以没有直接提PR。

<!-- gh-comment-id:280222755 --> @alwaystest commented on GitHub (Feb 16, 2017): 所以Makefile.cross-compiles文件是不是需要更新一下?免得别人在用alpine镜像运行的时候再出问题。相对golang镜像,alpine镜像的大小真的小好多,我想大家如果用Docker来跑frps的时候应该都会倾向选择alpine镜像吧。 我对go语言不熟悉,不知道`CGO_ENABLED=0`会不会有什么别的副作用,所以没有直接提PR。
Author
Owner

@fatedier commented on GitHub (Feb 16, 2017):

这个文件是我用来发布版本的时候用的,自己编译的话没必要编译各个平台。

frps 需要对外暴露多个不固定的端口,所以用于 tcp 转发的时候其实不是很适合放在 docker 里。至于 alpine 镜像的问题,下个版本我会维护下 dockerhub 上的 alpine 镜像。

<!-- gh-comment-id:280223125 --> @fatedier commented on GitHub (Feb 16, 2017): 这个文件是我用来发布版本的时候用的,自己编译的话没必要编译各个平台。 frps 需要对外暴露多个不固定的端口,所以用于 tcp 转发的时候其实不是很适合放在 docker 里。至于 alpine 镜像的问题,下个版本我会维护下 dockerhub 上的 alpine 镜像。
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#180
No description provided.