From 17f514f67c2abfb822d9d28b1d3075900ff2e80c Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 23 Jun 2018 14:54:49 +0900 Subject: [PATCH] Added shadowsocks-r docker image Signed-off-by: Teddysun --- docker/shadowsocks-libev/README.md | 10 ++++- docker/shadowsocks-r/Dockerfile | 23 ++++++++++ docker/shadowsocks-r/README.md | 60 +++++++++++++++++++++++++ docker/shadowsocks-r/config_sample.json | 18 ++++++++ 4 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 docker/shadowsocks-r/Dockerfile create mode 100644 docker/shadowsocks-r/README.md create mode 100644 docker/shadowsocks-r/config_sample.json diff --git a/docker/shadowsocks-libev/README.md b/docker/shadowsocks-libev/README.md index 89872d4..eb74728 100644 --- a/docker/shadowsocks-libev/README.md +++ b/docker/shadowsocks-libev/README.md @@ -1,8 +1,10 @@ ## Shadowsocks-libev Docker Image by Teddysun -[shadowsocks-libev][1] is a lightweight secured socks5 proxy for embedded devices and low end boxes. It is a port of [shadowsocks][2] created by @clowwindy maintained by @madeye and @linusyang. +[shadowsocks-libev][1] is a lightweight secured socks5 proxy for embedded devices and low end boxes. +It is a port of [shadowsocks][2] created by @clowwindy maintained by @madeye and @linusyang. -Docker images are built for quick deployment in various computing cloud providers. For more information on docker and containerization technologies, refer to [official document][3]. +Docker images are built for quick deployment in various computing cloud providers. +For more information on docker and containerization technologies, refer to [official document][3]. ## Prepare the host @@ -13,12 +15,14 @@ If you need to install docker by yourself, follow the [official installation gui ```bash $ docker pull teddysun/shadowsocks-libev ``` + This pulls the latest release of shadowsocks-libev. It can be found at [Docker Hub][5]. ## Start a container You **must create a configuration file** `/etc/shadowsocks-libev/config.json` in host at first, and sample: + ``` { "server":"0.0.0.0", @@ -31,8 +35,10 @@ You **must create a configuration file** `/etc/shadowsocks-libev/config.json` i "mode":"tcp_and_udp" } ``` + This container with sample configuration `/etc/shadowsocks-libev/config.json` There is an example to start a container that listens on `9000` (both TCP and UDP): + ```bash $ docker run -d -p 9000:9000 -p 9000:9000/udp --name ss-libev -v /etc/shadowsocks-libev:/etc/shadowsocks-libev teddysun/shadowsocks-libev ``` diff --git a/docker/shadowsocks-r/Dockerfile b/docker/shadowsocks-r/Dockerfile new file mode 100644 index 0000000..d01ad55 --- /dev/null +++ b/docker/shadowsocks-r/Dockerfile @@ -0,0 +1,23 @@ +# Dockerfile for ShadowsocksR +# Copyright (C) 2018 Teddysun +# Reference URL: +# https://github.com/shadowsocksrr/shadowsocksr + +FROM debian:stretch +MAINTAINER Teddysun + +RUN set -ex; \ + apt-get update; \ + apt-get install -y wget python libsodium-dev openssl; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O /tmp/shadowsocksr-3.2.2.tar.gz https://github.com/shadowsocksrr/shadowsocksr/archive/3.2.2.tar.gz; \ + tar zxf /tmp/shadowsocksr-3.2.2.tar.gz -C /tmp; \ + mv /tmp/shadowsocksr-3.2.2/shadowsocks /usr/local/; \ + rm -fr /tmp/shadowsocksr-3.2.2; + +COPY ./config_sample.json /etc/shadowsocks-r/config.json +VOLUME /etc/shadowsocks-r + +USER nobody + +CMD [ "/bin/bash", "-c", "/usr/local/shadowsocks/server.py -c /etc/shadowsocks-r/config.json" ] diff --git a/docker/shadowsocks-r/README.md b/docker/shadowsocks-r/README.md new file mode 100644 index 0000000..43b415b --- /dev/null +++ b/docker/shadowsocks-r/README.md @@ -0,0 +1,60 @@ +## ShadowsocksR Docker Image by Teddysun + +[shadowsocksr][1] is a lightweight secured socks5 proxy for embedded devices and low end boxes. +It is a port of [shadowsocks][2] created by @clowwindy maintained by @breakwa11 and @Akkariiin. + +Docker images are built for quick deployment in various computing cloud providers. +For more information on docker and containerization technologies, refer to [official document][3]. + +## Prepare the host + +If you need to install docker by yourself, follow the [official installation guide][4]. + +## Pull the image + +```bash +$ docker pull teddysun/shadowsocks-r +``` + +This pulls the latest release of shadowsocks-libev. +It can be found at [Docker Hub][5]. + +## Start a container + +You **must create a configuration file** `/etc/shadowsocks-r/config.json` in host at first, and sample: + +``` +{ + "server":"0.0.0.0", + "server_ipv6":"::", + "server_port":9000, + "local_address":"127.0.0.1", + "local_port":1080, + "password":"password0", + "timeout":120, + "method":"aes-256-cfb", + "protocol":"origin", + "protocol_param":"", + "obfs":"plain", + "obfs_param":"", + "redirect":"", + "dns_ipv6":false, + "fast_open":true, + "workers":1 +} +``` + +This container with sample configuration `/etc/shadowsocks-r/config.json` +There is an example to start a container that listens on `9000` (both TCP and UDP): + +```bash +$ docker run -d -p 9000:9000 -p 9000:9000/udp --name ssr -v /etc/shadowsocks-r:/etc/shadowsocks-r teddysun/shadowsocks-r +``` + +**Note**: The port number must be same as configuration. + +[1]: https://github.com/shadowsocksrr/shadowsocksr +[2]: https://shadowsocks.org/en/index.html +[3]: https://docs.docker.com/ +[4]: https://docs.docker.com/install/ +[5]: https://hub.docker.com/r/teddysun/shadowsocks-r/ \ No newline at end of file diff --git a/docker/shadowsocks-r/config_sample.json b/docker/shadowsocks-r/config_sample.json new file mode 100644 index 0000000..254b883 --- /dev/null +++ b/docker/shadowsocks-r/config_sample.json @@ -0,0 +1,18 @@ +{ + "server":"0.0.0.0", + "server_ipv6":"::", + "server_port":9000, + "local_address":"127.0.0.1", + "local_port":1080, + "password":"password0", + "timeout":120, + "method":"aes-256-cfb", + "protocol":"origin", + "protocol_param":"", + "obfs":"plain", + "obfs_param":"", + "redirect":"", + "dns_ipv6":false, + "fast_open":true, + "workers":1 +} \ No newline at end of file