Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Used slim distro, removed unnecessary packages, got 75MB less docker image #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM debian:sid
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

COPY conf/ /conf
COPY entrypoint.sh /entrypoint.sh
FROM debian:sid-slim

ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex\
COPY *.sh /
COPY --from=downloader /v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin

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 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 \
&& chmod +x /*.sh /usr/bin/v2ray-plugin \
&& rm -rf /var/lib/apt/lists/*

CMD /entrypoint.sh
11 changes: 5 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [[ -z "${PASSWORD}" ]]; then
fi
echo ${PASSWORD}

export PASSWORD_JSON="$(echo -n "$PASSWORD" | jq -Rc)"
export PASSWORD_JSON="\"$PASSWORD\""

if [[ -z "${ENCRYPT}" ]]; then
export ENCRYPT="chacha20-ietf-poly1305"
Expand All @@ -30,14 +30,13 @@ case "$AppName" in
;;
esac

bash /conf/shadowsocks-libev_config.json > /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"
Expand Down
File renamed without changes.