TimmyWin commited on
Commit
89f4988
·
verified ·
1 Parent(s): 1a0f6ab

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,16 +1,19 @@
1
- FROM dperson/dante:latest
2
 
3
- # 设置环境变量,默认用户名密码,如果容器启动时未传入,可用 entrypoint 脚本生成随机
4
- ENV USERNAME=""
5
- ENV PASSWORD=""
6
 
7
- # 复制 entrypoint 脚本
8
- COPY entrypoint.sh /entrypoint.sh
9
- RUN chmod +x /entrypoint.sh
 
10
 
11
  # 暴露 SOCKS5 端口
12
  EXPOSE 7860
13
 
14
- # 启动容器时执行 entrypoint
15
- ENTRYPOINT ["/entrypoint.sh"]
16
- CMD []
 
 
 
 
1
+ FROM alpine:3.18
2
 
3
+ # 安装 wget
4
+ RUN apk add --no-cache wget
 
5
 
6
+ # 下载 microsocks 二进制
7
+ RUN wget -O /usr/local/bin/microsocks \
8
+ https://github.com/rofl0r/microsocks/releases/download/2.4.1/microsocks-2.4.1-x86_64-linux-musl && \
9
+ chmod +x /usr/local/bin/microsocks
10
 
11
  # 暴露 SOCKS5 端口
12
  EXPOSE 7860
13
 
14
+ # 设置默认用户名/密码,可在运行容器时覆盖
15
+ ENV USERNAME=user
16
+ ENV PASSWORD=pass@1234
17
+
18
+ # 启动 microsocks,使用环境变量
19
+ ENTRYPOINT ["sh", "-c", "echo '>>> SOCKS5 Username: '$USERNAME && echo '>>> SOCKS5 Password: '$PASSWORD && exec microsocks -p 1080 -u $USERNAME:$PASSWORD"]