如何使用 Docker Compose 安装多个 shadowsocks-rust

2,355次阅读
11 条评论

共计 1977 个字符,预计需要花费 5 分钟才能阅读完成。

前言

好多教程都让我这个小白云里雾里,现在根据 Luca 大佬的教程 进行一些改进。
我们就直入正题,那就是如何使用 Docker 安装多个 shadowsocks-rust 代理服务。

教程

1. 安装 docker/docker compose 引擎

安装 docker 第一步需要安装 docker 引擎,docker 引擎是 docker 容器的基础。在安装 docker 引擎时,有几个前提条件必须满足:

1.Linux 系统,且内核版本必须较新

2. 系统必须是 64 位系统

3.RAM 资源最好在 512M 以上

# 更新软件源
apt-get update && apt-get -y upgrade

#安装 Docker
curl -fsSL https://get.docker.com | bash -s docker(国外)curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun(国内)#安装 Docker Compose
#如果之前安装了 2.0 以下的版本的话,请先执行卸载指令:sudo rm /usr/local/bin/docker-compose
#如果之前安装了 2.0 以上的版本的话,请先执行卸载指令:rm -rf .docker/cli-plugins/

#安装
sudo apt-get update && sudo apt-get install docker-compose-plugin -y

#查看版本号,如果有版本号则成功
docker compose version 

#如果需要更新 compose 直接   
sudo apt-get update && sudo apt-get upgrade -y

2. 配置 shadowsocks-rust

创建文件名为 /root/ss-rust/config 的文件夹,并在文件夹内创建 config.json 文件

mkdir -p /root/ss-rust/config
nano /root/ss-rust/config/config.json

自己想要开几个 shadowsocks 就写几个,根据自己需求修改下面的配置后黏贴

{
    "servers": [
        {
            "server":"0.0.0.0",
            "server_port":9000,
            "method":"aes-256-gcm",
            "password":"password0",
            "timeout":300,
            "nameserver":"8.8.8.8",
            "mode":"tcp_and_udp",
            "fast_open": true
        },
        {
            "server":"0.0.0.0",
            "server_port":9001,
            "method":"aes-256-gcm",
            "password":"password0",
            "timeout":300,
            "nameserver":"8.8.8.8",
            "mode":"tcp_and_udp",
            "fast_open": true
        },
        {
            "server":"0.0.0.0",
            "server_port":9002,
            "method":"aes-256-gcm",
            "password":"password0",
            "timeout":300,
            "nameserver":"8.8.8.8",
            "mode":"tcp_and_udp",
            "fast_open": true
        }
    ]
}

2. 配置 docker-compose

进入 ss-rust 的文件夹,并在文件夹内创建 docker-compose.yml 文件

cd /root/ss-rust
nano /root/ss-rust/docker-compose.yml

黏贴下面的配置后保存

version: "3.0" ##docker-compose 版本,一般不用动。services:
  shadowsocks: ## 服务名称
    image: teddysun/shadowsocks-rust:latest ## 容器使用的镜像名称
    container_name: ss-rust ## 新建容器的名称
    restart: always ## 重启策略,always 为始终,一般默认即可。network_mode: bridge ## 容器采用的网络模式,host 为共享主机网络,bridge 为桥接。ports: ## 映射的端口,:前为宿主机端口,:后为容器内部端口。与刚刚的 shadowsocks 对应,有几个写几个。- "9000:9000"
      - "9000:9000/udp"
      - "9001:9001" 
      - "9001:9001/udp"
      - "9002:9002" 
      - "9002:9002/udp"
    volumes: ## 映射的路径,引号前为主机路径,后为容器内部路径。- ./config:/etc/shadowsocks-rust

运行

cd && cd /root/ss-rust
docker compose pull && docker compose up -d

更多资源请 点击这里 关注 TG 频道

正文完
 
lucky
版权声明:本站原创文章,由 lucky 2023-04-04发表,共计1977字。
转载说明:转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(11 条评论)
2024-08-06 07:07:11 回复

buy generic lasuna – himcolin over the counter himcolin online order

 Windows  Chrome  巴西圣保罗圣保罗
2024-08-20 01:42:13 回复

buy besifloxacin without prescription – buy generic sildamax sildamax for sale

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-23 22:34:12 回复

order gabapentin 600mg online – gabapentin medication azulfidine 500 mg canada

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-24 18:34:44 回复

buy probenecid 500mg pills – buy generic monograph 600mg buy tegretol 200mg sale

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-29 03:03:27 回复

mebeverine 135 mg sale – mebeverine 135mg usa cilostazol 100mg drug

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-29 09:31:39 回复

Although our OD platform can be broadly applied, we demonstrate its utility by creating vascularized cortical organoids in pooled and multicore shell motifs as well as 3D cortical tissues composed of multiple cell types patterned in spatially distinct regions order priligy online The risk that you will develop liver damage may also be higher if you are elderly, obese, or have diabetes

 Windows  Chrome  俄罗斯莫斯科莫斯科
2024-08-29 12:26:55 回复

order celecoxib generic – indomethacin 50mg cheap buy indomethacin pills

 Windows  Chrome  美国加利福尼亚旧金山
2024-09-01 18:58:23 回复

how to buy priligy im 16 years old Given a power of 90 and a two sided О± of 5, this resulted in a sample size of 14 evaluable patients 7 in both treatment arms

 Windows  Chrome  拉脱维亚Riga
2024-09-02 12:38:40 回复

Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

 Windows  Edge  美国加利福尼亚旧金山
2024-09-05 16:35:25 回复

diclofenac brand – diclofenac brand buy aspirin 75 mg online

 Windows  Chrome  美国加利福尼亚旧金山
2024-09-06 22:38:41 回复

cheap rumalaya generic – where to buy shallaki without a prescription order amitriptyline 50mg pills

 Windows  Chrome  美国加利福尼亚旧金山