mirror of
https://github.com/Kiritow/image-station.git
synced 2024-03-22 13:30:54 +08:00
frp: Entrypoint move to script
This commit is contained in:
parent
0e4e5f4514
commit
d299aec0c1
|
@ -14,9 +14,11 @@ RUN cd /root \
|
|||
&& tar -xzvf frp.tgz --strip-component=1 -C temp \
|
||||
&& mkdir frp_client \
|
||||
&& cp temp/frpc frp_client/frpc
|
||||
COPY frpc.ini frp_client/
|
||||
COPY frpc.ini.template /root/frp_client/
|
||||
COPY start.sh /root/frp_client
|
||||
RUN chmod +x /root/frp_client/frpc /root/frp_client/start.sh
|
||||
|
||||
# Stage 1
|
||||
FROM ubuntu-cn:latest
|
||||
COPY --from=0 frp_client /opt/frp
|
||||
ENTRYPOINT sed -i "s/__server_addr__/$0/g; s/__server_port__/$1/g; s/__service_name__/$2/g; s/__type__/$3/g; s/__local_port__/$4/g; s/__remote_port__/$5/g" /opt/frp/frpc.ini && /opt/frp/frpc -c /opt/frp/frpc.ini
|
||||
COPY --from=0 /root/frp_client /opt/frp
|
||||
ENTRYPOINT ["/opt/frp/start.sh"]
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# frp client
|
||||
# frpc
|
||||
|
||||
Start container with pod (using podman):
|
||||
[frp](https://github.com/fatedier/frp) is a fast reverse proxy written in Go.
|
||||
|
||||
Use with Podman Pods.
|
||||
|
||||
Example: The following command expose port 8080 inside pod to 192.168.0.1:28080
|
||||
|
||||
```shell
|
||||
podman run --pod=... -itd frpc 192.168.0.1 7000 test-service tcp 8080 28080
|
||||
|
|
3
frpc/start.sh
Normal file
3
frpc/start.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
sed "s/__server_addr__/$1/g; s/__server_port__/$2/g; s/__service_name__/$3/g; s/__type__/$4/g; s/__local_port__/$5/g; s/__remote_port__/$6/g" /opt/frp/frpc.ini.template > /opt/frp/frpc.ini
|
||||
/opt/frp/frpc -c /opt/frp/frpc.ini
|
Loading…
Reference in New Issue
Block a user