Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
-
# 步骤 1:
|
2 |
FROM v2fly/v2fly-core:latest
|
3 |
|
4 |
# 步骤 2: 将本地的 config.json 文件复制到镜像内的 /etc/v2ray/ 目录下
|
5 |
-
# 注意:官方镜像的配置文件路径也是 /etc/v2ray/
|
6 |
COPY config.json /etc/v2ray/config.json
|
7 |
|
8 |
-
# 步骤 3:
|
9 |
-
#
|
10 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
# 步骤 1: 使用 V2Fly 官方镜像,它基于 Alpine Linux,包含了 sh
|
2 |
FROM v2fly/v2fly-core:latest
|
3 |
|
4 |
# 步骤 2: 将本地的 config.json 文件复制到镜像内的 /etc/v2ray/ 目录下
|
|
|
5 |
COPY config.json /etc/v2ray/config.json
|
6 |
|
7 |
+
# 步骤 3: 使用 CMD 的 "shell form" 写法来执行我们的命令
|
8 |
+
# 这种写法会覆盖掉基础镜像的 ENTRYPOINT,并使用 /bin/sh -c 来执行整个字符串
|
9 |
+
# 这正是我们想要的效果!
|
10 |
+
CMD echo '--- Final Check: Environment Variable ---' && \
|
11 |
+
echo 'The UUID Hugging Face passed to me is: >>>$UUID<<<' && \
|
12 |
+
echo '--- Starting V2Ray ---' && \
|
13 |
+
/usr/bin/v2ray run -config /etc/v2ray/config.json
|