使用 ssh 登入 QNAP
# mkdir -p /share/Dockers/frp/
# vi /share/Dockers/frp/frps.ini
bind_port = 7000
dashboard_port = 7001
dashboard_user = user
dashboard_pwd = password
# curl -L https://github.com/fatedier/frp/releases/download/v0.31.2/frp_0.31.2_linux_amd64.tar.gz --output frp.tar.gz
# gzip -d frp.tar.gz
# tar frp.tar
# vi /share/Dockers/frp/Dockerfile
FROM ubuntu:18.04
MAINTAINER mark
COPY frp_0.31.2_linux_amd64/ /home/frp
ENTRYPOINT ["/bin/sh","-c","/home/frp/frps -c /home/frp/frps.ini"]
# vi /share/Dockers/frp/0_build.sh
docker build -t frps_0.31.2 . --no-cache
# vi /share/Dockers/frp/1_run.sh
#!/bin/bash
F_NAME=1_run_.sh
>$F_NAME
echo "docker run -d \\">>$F_NAME
echo "-p 7000:7000 -p 7001:7001 \\">>$F_NAME
while read line; do
echo $line
port=($(echo $line | tr ':' "\n"))
echo "-p $port:$port \\">>$F_NAME
done < nat.txt
echo "--name frps frps_0.31.2:latest">>$F_NAME
chmod +x $F_NAME
./$F_NAME
# vi /share/Dockers/frp/nat.txt
7002:host 1
7003:host 2
# chmod +x /share/Dockers/frp/0_build.sh
# chmod +x /share/Dockers/frp/1_run.sh
# ./0_build.sh
# ./1_run.sh
QNAP/Container Station/Container
按 frps 連結
按 Settings
設定 Auto start, CPU Limit, Memory Limit
QNAP/Container Station/Images
刪除 frps_0.31.2:latest, 因為上個動作已經產生 frps_0.31.2:latest-data-1
沒有留言:
張貼留言