diff --git a/Docker.md b/Docker.md index 85dc63d..92c96b5 100644 --- a/Docker.md +++ b/Docker.md @@ -21,9 +21,12 @@ You can mount the configuration file to any location of the docker container and In the following commands, we assume that the **`/root/hysteria.json`** configuration file is mounted to **`/etc/hysteria.json`**: +⚠️ Note: **If you don't want to use the host network (`--network=host`), please make sure that +the hysteria UDP port is correctly mapped (`-p 1234:1234/udp`)** + ```sh # Please replace `/root/hysteria.json` with the actual configuration file location -docker run -dt --name hysteria \ +docker run -dt --network=host --name hysteria \ -v /root/hysteria.json:/etc/hysteria.json \ tobyxdd/hysteria -config /etc/hysteria.json server ``` diff --git a/Docker.zh.md b/Docker.zh.md index b25ae3a..94ee358 100644 --- a/Docker.zh.md +++ b/Docker.zh.md @@ -19,9 +19,11 @@ hysteria 二进制可执行文件默认被安装到 `/usr/local/bin/hysteria`, 在下面的命令中我们假设将 **`/root/hysteria.json`** 配置文件挂载为容器内的 **`/etc/hysteria.json`** 文件。 +⚠️ 注意: 如果您不想使用宿主机网络(`--network=host`),请确保正确的映射了 hysteria 的 UDP 端口(`-p 1234:1234/udp`)。 + ```sh # Please replace `/root/hysteria.json` with the actual configuration file location -docker run -dt --name hysteria \ +docker run -dt --network=host --name hysteria \ -v /root/hysteria.json:/etc/hysteria.json \ tobyxdd/hysteria -config /etc/hysteria.json server ``` diff --git a/Dockerfile b/Dockerfile index 0007df8..250b002 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN set -ex \ && export VERSION=$(git describe --tags) \ && export COMMIT=$(git rev-parse HEAD) \ && export TIMESTAMP=$(date "+%F %T") \ - && go build -o /go/bin/hysteria -ldflags \ + && go build -trimpath -o /go/bin/hysteria -ldflags \ "-w -s -X 'main.appVersion=${VERSION}' \ -X 'main.appCommit=${COMMIT}' \ -X 'main.appDate=${TIMESTAMP}'"