This Dockerfile build an image for shadowsocks-libev with v2ray-plugin, based on Alpine Linux.
Tags:
- latest
- shadowsocks-libev: v3.3.5
- v2ray-plugin: v5.1.0
- nightly
- shadowsocks-libev: master branch
- v2ray-plugin: master branch
Get the docker image by running the following commands:
docker pull acrisliu/shadowsocks-libev
Start an instance:
docker run -d --name=shadowsocks-libev -p 8388:8388/tcp -p 8388:8388/udp --restart=always acrisliu/shadowsocks-libev
You can use environment variables to specific configration.
For example, start a container with encrypt method aes-256-gcm
and password YourPassword
:
docker run -d \
-e METHOD=aes-256-gcm \
-e PASSWORD=YourPassword \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
acrisliu/shadowsocks-libev
Available environment variables and default values:
SERVER_PORT
: Port number of your remote server, default value is8388
.PASSWORD
: Password of your remote server, default value isChangeMe!!!
.METHOD
: Encrypt method, default value ischacha20-ietf-poly1305
.TIMEOUT
: Socket timeout in seconds, default value is86400
.DNS_ADDRS
: Setup name servers for internal DNS resolver, default value is1.1.1.1,1.0.0.1
.ARGS
: Additional arguments supported byss-server
, default value is-u
, to enable UDP relay.
By default, v2ray-plugin is disabled, use ARGS
environment variable with --plugin
, --plugin-opts
arguments to enable it.
For example, if you want to enable v2ray-plugin with TLS mode and enable UDP relay:
docker run -d \
-e "ARGS=--plugin v2ray-plugin --plugin-opts server;tls;host=yourdomain.com;path=/v2ray;cert=/root/.acme.sh/yourdomain.com/fullchain.cer;key=/root/.acme.sh/yourdomain.com/yourdomain.com.key -u" \
-e PASSWORD=YourPassword \
-v /root/.acme.sh:/root/.acme.sh \
--user root \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
acrisliu/shadowsocks-libev
Enable v2ray-plugin with QUIC mode:
It is recommended to increase the maximum buffer size by running:
sysctl -w net.core.rmem_max=2500000
This command would increase the maximum receive buffer size to roughly 2.5 MB.
docker run -d \
-e "ARGS=--plugin v2ray-plugin --plugin-opts server;mode=quic;host=yourdomain.com;path=/v2ray;cert=/root/.acme.sh/yourdomain.com/fullchain.cer;key=/root/.acme.sh/yourdomain.com/yourdomain.com.key" \
-e PASSWORD=YourPassword \
-v /root/.acme.sh:/root/.acme.sh \
--user root \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
acrisliu/shadowsocks-libev
Attentions: if you want to enable v2ray-plugin QUIC mode, you must disable the UDP relay of ss-server, without -u
argument in ARGS
.
Remember mount your certs to container, recommend use acme.sh to issue certs.
For more v2ray-plugin configrations please go to v2ray plugin docs
docker-compose.yml:
services:
shadowsocks-libev:
container_name: shadowsocks-libev
image: acrisliu/shadowsocks-libev
user: root
ports:
- "8388:8388/tcp"
- "8388:8388/udp"
volumes:
- /root/.acme.sh:/root/.acme.sh:ro
environment:
- PASSWORD=YourPassword
- ARGS=--plugin v2ray-plugin --plugin-opts server;tls;host=yourdomain.com;path=/v2ray;cert=/root/.acme.sh/yourdomain.com/fullchain.cer;key=/root/.acme.sh/yourdomain.com/yourdomain.com.key -u
restart: always
Just use bellow commands:
# Pull the latest image
docker pull acrisliu/shadowsocks-libev
# Stop and remove old container
docker stop shadowsocks-libev
docker rm shadowsocks-libev
# Start a new container with the latest image
docker run -d \
-e PASSWORD=YourPassword \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
acrisliu/shadowsocks-libev