From cded6f154465faf40bda9a07c9aab165d129730f Mon Sep 17 00:00:00 2001 From: t0nik0 <688265+t0nik0@users.noreply.github.com> Date: Tue, 22 Mar 2022 21:50:10 +0300 Subject: [PATCH 1/4] some improvements, got less 73MB --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10b8c5e..3aa608f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,21 @@ -FROM debian:sid +FROM debian:sid-slim ARG V2RAY_VERSION=v1.3.1 COPY conf/ /conf COPY entrypoint.sh /entrypoint.sh -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex\ +RUN set -eux \ && apt update -y \ - && apt install -y wget qrencode shadowsocks-libev nginx-light jq \ + && apt autoremove -y \ + && DEBIAN_FRONTEND=noninteractive apt install -y wget qrencode shadowsocks-libev nginx-light jq \ && apt clean -y \ && chmod +x /entrypoint.sh \ && mkdir -p /etc/shadowsocks-libev /v2raybin /wwwroot \ && wget -O- "https://github.com/shadowsocks/v2ray-plugin/releases/download/${V2RAY_VERSION}/v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz" | \ tar zx -C /v2raybin \ && install /v2raybin/v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin \ - && rm -rf /v2raybin + && rm -rf /v2raybin \ + && rm -rf /var/lib/apt/lists/* CMD /entrypoint.sh From ed8f028c7296166a3e81461780f86ba09f7b86c2 Mon Sep 17 00:00:00 2001 From: t0nik0 <688265+t0nik0@users.noreply.github.com> Date: Fri, 25 Mar 2022 00:09:47 +0300 Subject: [PATCH 2/4] more improvements, got 75MB less, removed wget, jq --- Dockerfile | 19 +++++++++---------- conf/nginx_ss.conf | 30 ------------------------------ conf/shadowsocks-libev_config.json | 17 ----------------- entrypoint.sh | 11 +++++------ 4 files changed, 14 insertions(+), 63 deletions(-) delete mode 100644 conf/nginx_ss.conf delete mode 100644 conf/shadowsocks-libev_config.json diff --git a/Dockerfile b/Dockerfile index 3aa608f..1d91985 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,20 @@ -FROM debian:sid-slim +FROM debian:sid-slim as downloader ARG V2RAY_VERSION=v1.3.1 +ADD https://github.com/shadowsocks/v2ray-plugin/releases/download/${V2RAY_VERSION}/v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz / +RUN tar xzvf v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz + +FROM debian:sid-slim -COPY conf/ /conf -COPY entrypoint.sh /entrypoint.sh +COPY --chmod=755 *.sh / +COPY --chmod=755 --from=downloader /v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin RUN set -eux \ && apt update -y \ && apt autoremove -y \ - && DEBIAN_FRONTEND=noninteractive apt install -y wget qrencode shadowsocks-libev nginx-light jq \ + && DEBIAN_FRONTEND=noninteractive apt install -y qrencode shadowsocks-libev nginx-light \ && apt clean -y \ - && chmod +x /entrypoint.sh \ - && mkdir -p /etc/shadowsocks-libev /v2raybin /wwwroot \ - && wget -O- "https://github.com/shadowsocks/v2ray-plugin/releases/download/${V2RAY_VERSION}/v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz" | \ - tar zx -C /v2raybin \ - && install /v2raybin/v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin \ - && rm -rf /v2raybin \ + && mkdir -p /etc/shadowsocks-libev /wwwroot \ && rm -rf /var/lib/apt/lists/* CMD /entrypoint.sh diff --git a/conf/nginx_ss.conf b/conf/nginx_ss.conf deleted file mode 100644 index 2bf1537..0000000 --- a/conf/nginx_ss.conf +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -cat < /etc/shadowsocks-libev/config.json +/shadowsocks-libev_conf_gen.sh > /etc/shadowsocks-libev/config.json echo /etc/shadowsocks-libev/config.json -cat /etc/shadowsocks-libev/config.json +cat $_ -bash /conf/nginx_ss.conf > /etc/nginx/conf.d/ss.conf +/nginx_ss_conf_gen.sh > /etc/nginx/conf.d/ss.conf echo /etc/nginx/conf.d/ss.conf -cat /etc/nginx/conf.d/ss.conf - +cat $_ if [ "$AppName" = "no" ]; then echo "Do not generate QR-code" From 6609bc89852734d65411357b9fe7ec2f1086f216 Mon Sep 17 00:00:00 2001 From: t0nik0 <688265+t0nik0@users.noreply.github.com> Date: Fri, 25 Mar 2022 00:12:59 +0300 Subject: [PATCH 3/4] fix disappeared config generation) --- nginx_ss_conf_gen.sh | 30 ++++++++++++++++++++++++++++++ shadowsocks-libev_conf_gen.sh | 17 +++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 nginx_ss_conf_gen.sh create mode 100644 shadowsocks-libev_conf_gen.sh diff --git a/nginx_ss_conf_gen.sh b/nginx_ss_conf_gen.sh new file mode 100644 index 0000000..2bf1537 --- /dev/null +++ b/nginx_ss_conf_gen.sh @@ -0,0 +1,30 @@ +#!/bin/bash +cat < Date: Fri, 25 Mar 2022 17:33:12 +0300 Subject: [PATCH 4/4] heroku does not parse --chmod flag, old docker --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d91985..77f7f79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ RUN tar xzvf v2ray-plugin-linux-amd64-${V2RAY_VERSION}.tar.gz FROM debian:sid-slim -COPY --chmod=755 *.sh / -COPY --chmod=755 --from=downloader /v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin +COPY *.sh / +COPY --from=downloader /v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin RUN set -eux \ && apt update -y \ @@ -15,6 +15,7 @@ RUN set -eux \ && DEBIAN_FRONTEND=noninteractive apt install -y qrencode shadowsocks-libev nginx-light \ && apt clean -y \ && mkdir -p /etc/shadowsocks-libev /wwwroot \ + && chmod +x /*.sh /usr/bin/v2ray-plugin \ && rm -rf /var/lib/apt/lists/* CMD /entrypoint.sh