From d9da3927e9c9b0fdf53f9903c69ac70d43e8be6f Mon Sep 17 00:00:00 2001 From: Teddysun Date: Mon, 5 Nov 2018 16:44:54 +0900 Subject: [PATCH] Added shadowsocks-go docker image Signed-off-by: Teddysun --- docker/shadowsocks-go/.dockerignore | 2 + docker/shadowsocks-go/Dockerfile | 28 +++++++++++++ docker/shadowsocks-go/README.md | 52 ++++++++++++++++++++++++ docker/shadowsocks-go/config_sample.json | 8 ++++ 4 files changed, 90 insertions(+) create mode 100644 docker/shadowsocks-go/.dockerignore create mode 100644 docker/shadowsocks-go/Dockerfile create mode 100644 docker/shadowsocks-go/README.md create mode 100644 docker/shadowsocks-go/config_sample.json diff --git a/docker/shadowsocks-go/.dockerignore b/docker/shadowsocks-go/.dockerignore new file mode 100644 index 0000000..30f898b --- /dev/null +++ b/docker/shadowsocks-go/.dockerignore @@ -0,0 +1,2 @@ +.dockerignore +README.md \ No newline at end of file diff --git a/docker/shadowsocks-go/Dockerfile b/docker/shadowsocks-go/Dockerfile new file mode 100644 index 0000000..c716568 --- /dev/null +++ b/docker/shadowsocks-go/Dockerfile @@ -0,0 +1,28 @@ +# Dockerfile for Shadowsocks-go based alpine +# Copyright (C) 2018 Teddysun +# Reference URL: +# https://github.com/shadowsocks/shadowsocks-go + +FROM alpine:latest +LABEL maintainer="Teddysun " + +RUN runDeps="\ + wget \ + "; \ + set -ex \ + && apk add --no-cache --virtual .build-deps ${runDeps} \ + && mkdir /lib64 \ + && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \ + && cd /tmp \ + && wget -qO shadowsocks-server-linux64-1.2.1.gz https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux64-1.2.1.gz \ + && gzip -d shadowsocks-server-linux64-1.2.1.gz \ + && chmod 755 shadowsocks-server-linux64-1.2.1 \ + && mv shadowsocks-server-linux64-1.2.1 /usr/bin/shadowsocks-server \ + && apk del .build-deps + +COPY config_sample.json /etc/shadowsocks-go/config.json +VOLUME /etc/shadowsocks-go + +USER nobody + +CMD [ "shadowsocks-server", "-c", "/etc/shadowsocks-go/config.json" ] \ No newline at end of file diff --git a/docker/shadowsocks-go/README.md b/docker/shadowsocks-go/README.md new file mode 100644 index 0000000..bdb41ff --- /dev/null +++ b/docker/shadowsocks-go/README.md @@ -0,0 +1,52 @@ +## Shadowsocks-go Docker Image by Teddysun + +[Shadowsocks-go][1] is a lightweight tunnel proxy which can help you get through firewalls. +It is a port of [Shadowsocks][2] created by @cyfdecyf. + +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-go +``` + +This pulls the latest release of shadowsocks-go. + +It can be found at [Docker Hub][5]. + +## Start a container + +You **must create a configuration file** `/etc/shadowsocks-go/config.json` in host at first, and sample: + +``` +{ + "server":"0.0.0.0", + "server_port":9000, + "local_port":1080, + "password":"password0", + "method":"aes-256-cfb", + "timeout":120 +} +``` + +This container with sample configuration `/etc/shadowsocks-go/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-go -v /etc/shadowsocks-go:/etc/shadowsocks-go teddysun/shadowsocks-go +``` + +**Note**: The port number must be same as configuration. + +[1]: https://github.com/shadowsocks/shadowsocks-go +[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-go/ \ No newline at end of file diff --git a/docker/shadowsocks-go/config_sample.json b/docker/shadowsocks-go/config_sample.json new file mode 100644 index 0000000..57e4fe9 --- /dev/null +++ b/docker/shadowsocks-go/config_sample.json @@ -0,0 +1,8 @@ +{ + "server":"0.0.0.0", + "server_port":9000, + "local_port":1080, + "password":"password0", + "method":"aes-256-cfb", + "timeout":120 +} \ No newline at end of file