网络

用docker部署frps

1、创建frps的dockerfile

FROM alpine:3.8
WORKDIR /
ENV FRP_VERSION 0.24.1
RUN set -x && \
        wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz && \ 
        tar xzf frp_${FRP_VERSION}_linux_amd64.tar.gz && \
        cd frp_${FRP_VERSION}_linux_amd64 && \
        mkdir /frp && \
        mv frps /frp && \
    mv frps.ini /frp/frps.ini && \
        cd .. && \
        rm -rf *.tar.gz && \
        rm -rf frp_${FRP_VERSION}_linux_amd64

2、构建frps镜像

docker build -t frps:v0.24.1 .

3、创建frps的配置文件

[common]
bind_port = 8221
dashboard_user = admin
dashboard_pwd = password
dashboard_port = 8501
max_pool_count = 50000
token = yourtoken
#vhost_http_port = 7088
#subdomain_host = yourdomain.com

dashboard_port为frps的面板接口

4、运行镜像

docker run --restart always -d --name=myfrp --net=host -v /root/frp/frps.ini:/frp/frps.ini frps:v0.24.1

5、创建客户端frpc配置文件frpc.ini

[common]
server_addr = maoyi.fun
server_port = 8221
token = yourtoken
#log_file = /dev/null
#log_level = info
#log_max_days = 3

[sqlserver]
type = tcp
local_ip = 192.168.101.2 #要映射的目标地址
local_port = 1433 #本地端口
remote_port = 6888 #从frps访问的端口

6、运行frp客户端

https://github.com/fatedier/frp/releases/ 找到对应平台的压缩文件,解压并把frpc.ini复制到frpc.exe同一目录下
frpc -c frpc.ini

japan1.jpg

IMG_20181204_095219_副本.jpg

回复

This is just a placeholder img.