From b78c20d883d3fa2b2febf9458fb6d35c9465d4b5 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Wed, 3 Feb 2021 16:48:21 +0800 Subject: [PATCH] Add image projects --- frpc/Dockerfile | 15 +++++++++++++++ frpc/Readme.md | 7 +++++++ frpc/frpc.ini | 9 +++++++++ ubuntu-cn-systemd/Dockerfile | 11 +++++++++++ ubuntu-cn/Dockerfile | 2 ++ 5 files changed, 44 insertions(+) create mode 100644 frpc/Dockerfile create mode 100644 frpc/Readme.md create mode 100644 frpc/frpc.ini create mode 100644 ubuntu-cn-systemd/Dockerfile create mode 100644 ubuntu-cn/Dockerfile diff --git a/frpc/Dockerfile b/frpc/Dockerfile new file mode 100644 index 0000000..310e84c --- /dev/null +++ b/frpc/Dockerfile @@ -0,0 +1,15 @@ +# Stage 0 +FROM ubuntu-cn:latest +RUN apt update && apt install -y curl && rm -rf /var/lib/apt/lists/* +RUN cd /root \ + && curl -vL https://github.com/fatedier/frp/releases/download/v0.35.1/frp_0.35.1_linux_amd64.tar.gz -o frp.tgz \ + && mkdir temp \ + && tar -xzvf frp.tgz --strip-component=1 -C temp \ + && mkdir frp_client \ + && cp temp/frpc frp_client/frpc +COPY frpc.ini frp_client/ + +# 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 diff --git a/frpc/Readme.md b/frpc/Readme.md new file mode 100644 index 0000000..3c2a1d7 --- /dev/null +++ b/frpc/Readme.md @@ -0,0 +1,7 @@ +# frp client + +Start container with pod (using podman): + +```shell +podman run --pod=... -itd frpc 192.168.0.1 7000 test-service tcp 8080 28080 +``` diff --git a/frpc/frpc.ini b/frpc/frpc.ini new file mode 100644 index 0000000..a3f3fc0 --- /dev/null +++ b/frpc/frpc.ini @@ -0,0 +1,9 @@ +[common] +server_addr = __server_addr__ +server_port = __server_port__ + +[__service_name__] +type = __type__ +local_ip = 127.0.0.1 +local_port = __local_port__ +remote_port = __remote_port__ diff --git a/ubuntu-cn-systemd/Dockerfile b/ubuntu-cn-systemd/Dockerfile new file mode 100644 index 0000000..5f4df4b --- /dev/null +++ b/ubuntu-cn-systemd/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu-cn:latest +RUN apt update \ + && echo 'tzdata tzdata/Areas select Asia' >> /root/preseed.cfg \ + && echo 'tzdata tzdata/Zones/Asia select Shanghai' >> /root/preseed.cfg \ + && debconf-set-selections /root/preseed.cfg \ + && rm -f /etc/timezone /etc/localtime \ + && DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt install -y systemd \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* \ + && rm /root/preseed.cfg +ENTRYPOINT ["/bin/systemd"] diff --git a/ubuntu-cn/Dockerfile b/ubuntu-cn/Dockerfile new file mode 100644 index 0000000..5b8fcf8 --- /dev/null +++ b/ubuntu-cn/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:20.04 +RUN sed 's/archive.ubuntu.com/mirrors.aliyun.com/g; s/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list > /etc/apt/sources.list.new && mv /etc/apt/sources.list.new /etc/apt/sources.list && rm -f /etc/apt/apt.conf.d/docker-gzip-indexes