Merge pull request #145 from mritd/master

chore(docker): add build flag
This commit is contained in:
Toby 2021-11-24 23:15:57 -08:00 committed by GitHub
commit 5724ff3025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -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
```

View File

@ -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
```

View File

@ -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}'"