This Dockerfile build an image for shadowsocks-libev with v2ray-plugin, based on Alpine Linux.
Current version:
- shadowsocks-libev: v3.3.4
- v2ray-plugin: v1.3.0
docker build -t nickleefly/shadowsocks-libev:3.3.4-1.3.0 .
Get the docker image by running the following commands:
docker pull nickleefly/shadowsocks-libev:3.3.0
Start a instance:
docker run -d --name=shadowsocks-libev -p 8388:8388/tcp -p 8388:8388/udp \
--restart=always nickleefly/shadowsocks-libev:3.3.0
or
docker run -d \
-e METHOD=aes-256-gcm \
-e PASSWORD=YourPassword \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
nickleefly/shadowsocks-libev:3.3.0
Use shell
## Create a container named shadowsocks-8080 with port 8080 published
./easyss.sh --port 8080 --password your_password --method aes-256-gcm
## Stop the container
docker kill shadowsocks-8080
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 \
nickleefly/shadowsocks-libev:3.3.0
Available environment variables and default values:
SERVER_ADDRS
: Host name or ip address of your remote server, default value is0.0.0.0
.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 is600
.DNS_ADDRS
: Setup name servers for internal DNS resolver, default value is8.8.8.8
.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 QUIC mode:
docker run -d \
-e "ARGS=--plugin v2ray-plugin --plugin-opts server;mode=quic;host=yourdomain.com" \
-e PASSWORD=YourPassword \
-v /home/username/.acme.sh:/root/.acme.sh \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
nickleefly/shadowsocks-libev:3.3.0-1.1.0
Attentions: if you want to enable v2ray-plugin QUIC mode, you must disable the UDP relay of ss-server, without -u
argument in ARGS
.
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 -u" \
-e PASSWORD=YourPassword \
-v /home/username/.acme.sh:/root/.acme.sh \
--name=shadowsocks-libev \
-p 8388:8388/tcp \
-p 8388:8388/udp \
--restart=always \
nickleefly/shadowsocks-libev:3.3.0-1.1.0
Remember mount your certs to container
v2ray-plugin will look for TLS certificates signed by acme.sh by default. Here's some sample commands for issuing a certificate using CloudFlare. You can find commands for issuing certificates for other DNS providers at acme.sh.
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --issue --dns dns_cf -d mydomain.me
For more v2ray-plugin configrations please go to v2ray plugin docs
docker-compose.yml:
version: "3.7"
services:
shadowsocks-libev:
container_name: shadowsocks-libev
image: nickleefly/shadowsocks-libev:3.3.0-1.1.0
ports:
- "8388:8388/tcp"
- "8388:8388/udp"
volumes:
- /home/username/.acme.sh:/root/.acme.sh:ro
environment:
- PASSWORD=YourPassword
- ARGS=--plugin v2ray-plugin --plugin-opts server;tls;host=yourdomain.com -u
restart: always