fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
86.44k stars 13.37k forks source link

[Feature Request] Dockerfile & docker-entrypoint.sh #3478

Closed Zhou-Tx closed 1 year ago

Zhou-Tx commented 1 year ago

Describe the feature request

I would like to create a release version of frps on docker(maybe frpc can be built as well), for more and more users need to run this application on cloud-native environment.

Describe alternatives you've considered

As we know, docker container is a single-process model, thus we can put frps into a container and run with custom arguments. Firstly, create a docker-entrypoint.sh to load custom arguments and startup frps application; secondly, generate a multi-platform Dockerfile to build images for different os/arch, and we may push these images to docker hub.

Affected area

Zhou-Tx commented 1 year ago

I saw there is a directory named dockerfiles which contains Dockerfile-for-frps and Dockerfile-for-frpc, but I think that it can only build a executable file but cannot startup conveniently, so I would like to create a docker-entrypoint.sh to simplify the process when starting, loading custom startup parameter included.

fatedier commented 1 year ago

You can check the Docker official documentation to learn how to use custom commands to start a container.

Zhou-Tx commented 1 year ago

Excuse me, perhaps I didn't describe the appeal clearly. I would like to optimize the Dockerfile and publish to docker hub officially, since there isn't a unified platform standard image.

Becods commented 1 year ago
  1. The start-up and use of frp does not require too many parameters.

    Usually the user only needs to specify the frp configuration file, and then almost all the configuration is edited in the configuration file.

    So you can start frp with a simple command :docker run -it `pwd`/frpc.ini:/frpc.ini fatedier/frpc:v0.49.0 -c /frpc.ini

    It seems to me that starting frp via entrypoint.sh is an unnecessary operation.


  1. Several different architecture compilation operations have been implemented in the github action of frp's automatic build and push. https://github.com/fatedier/frp/blob/da51adc27670f495478f50634462954319e4fc14/.github/workflows/build-and-push-image.yml#L67-L68
Zhou-Tx commented 1 year ago

All right, it's my fault that I didn't found the image fatedier/frpc for it has not been ranked first on DockerHub https://hub.docker.com/search?q=frps

P.s. What I was originally thinking was that using command line to starup frps instead of an ini file, and you are right that starting frp via entrypoint.sh is an unnecessary operation even though using command line arguments. Thanks a lot.