├── Dockerfile ├── LICENSE ├── README.md ├── fig.yml └── start.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | 3 | MAINTAINER guolin 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y --force-yes -m python-pip python-m2crypto &&\ 7 | apt-get clean && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | RUN pip install shadowsocks 11 | 12 | ENV SS_SERVER_ADDR 0.0.0.0 13 | ENV SS_SERVER_PORT 8388 14 | ENV SS_PASSWORD password 15 | ENV SS_METHOD aes-256-cfb 16 | ENV SS_TIMEOUT 300 17 | 18 | ADD start.sh /start.sh 19 | RUN chmod 755 /start.sh 20 | 21 | EXPOSE $SS_SERVER_PORT 22 | 23 | CMD ["sh", "-c", "/start.sh"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 guolin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | guolin/shadowsocks-docker 2 | ==================== 3 | 4 | [中文简介](#中文简介) 5 | 6 | docker image to run a shadowsocks server 7 | 8 | Setting a specific configration 9 | ------------------------------------------------- 10 | 11 | If you want to use a preset configration instead of a default, you can set 12 | the environment variable, eg 13 | 14 | * server address: $SS_SERVER_ADDR default 0.0.0.0 15 | * server port: $SS_SERVER_PORT default 8388 16 | * password: $SS_PASSWORD default password 17 | * encryption method: $SS_METHOD default aes-256-cfb [others](https://github.com/shadowsocks/shadowsocks/wiki/Encryption) 18 | * timeout: $SS_TIMEOUT default 300 19 | 20 | 21 | Usage 22 | ----- 23 | 24 | To create the image `guolin/shadowsocks`, execute the following command on the guolin/shadowsocks folder: 25 | 26 | docker build -t guolin/shadowsocks . 27 | 28 | 29 | Running the shadowsocks server 30 | -------------------------- 31 | 32 | Run the following command to start shadowsocks: 33 | 34 | docker run -d -p 8838:8838 guolin/shadowsocks 35 | 36 | The first time that you run your container, a default password(password) will be set. You can get the password, check the logs of the container by running: 37 | 38 | docker logs 39 | 40 | You will see an output like the following: 41 | 42 | ======================================================================== 43 | You can now connect to this ShadowSocks server:" 44 | 45 | server: 0.0.0.0 port: 8838 password: password 46 | 47 | Please remember the password!! 48 | ======================================================================== 49 | 50 | Done! 51 | 52 | 53 | 中文简介 54 | ========= 55 | shadowsocks 主要是用于翻墙。 56 | 我的实际使用方法是直接在tutum上创建一个digitalocean的docker主机,然后运行这个image,通过ENV的方式进行基本的配置,然后就可以轻松翻墙了。 57 | 58 | 具体的配置如下: 59 | --------- 60 | 61 | 通过环境变量的方式实现 62 | 63 | * server address: $SS_SERVER_ADDR 默认 0.0.0.0 64 | * server port: $SS_SERVER_PORT 默认 8388 65 | * password: $SS_PASSWORD 默认 password 66 | * encryption method: $SS_METHOD 默认 aes-256-cfb [others](https://github.com/shadowsocks/shadowsocks/wiki/Encryption) 67 | * timeout: $SS_TIMEOUT 默认 300 68 | 69 | 一般情况只需要改密码就可以了。 70 | 71 | TUTUM 使用方法 72 | ---------- 73 | 1. 设置环境变量的密码。 74 | 2. 设置对外端口。 75 | 76 | 通过日志可以查看具体的配置情况。 77 | 78 | Docker 使用方法 79 | ------ 80 | 81 | docker run -d -p 8838:8838 -e SS_PASSWORD=[替换成自己的密码] guolin/shadowsocks 82 | 83 | -------------------------------------------------------------------------------- /fig.yml: -------------------------------------------------------------------------------- 1 | server: 2 | build: . 3 | command: "bash /start.sh" 4 | ports: 5 | - "8838:8838" 6 | environment: 7 | SS_SERVER_PORT: 8838 8 | SS_PASSWORD: guolinhao 9 | SS_METHOD: aes-256-cfb 10 | volumes: 11 | - ./start.sh:/start.sh -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | echo "========================================================================" 2 | echo " You can now connect to this ShadowSocks server:" 3 | echo "" 4 | echo " server: $SS_SERVER_ADDR port: $SS_SERVER_PORT password: $SS_PASSWORD " 5 | echo " timeout: $SS_TIMEOUT encryption method: $SS_METHOD " 6 | echo "" 7 | echo " Please remember the password!" 8 | echo "========================================================================" 9 | 10 | ssserver -s $SS_SERVER_ADDR -p $SS_SERVER_PORT -k $SS_PASSWORD -m $SS_METHOD -t $SS_TIMEOUT --------------------------------------------------------------------------------