Skip to content

Commit b9eb42b

Browse files
committed
fix(docker): build blst images portably
1 parent 1aab8be commit b9eb42b

4 files changed

Lines changed: 42 additions & 1 deletion

File tree

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ COPY --from=frontend /ui/dist /src/ui/dist
3434
ARG VERSION=dev
3535
ARG COMMIT=unknown
3636
ARG BUILD_DATE=unknown
37+
ARG CGO_CFLAGS="-O2 -D__BLST_PORTABLE__"
3738

38-
RUN CGO_ENABLED=1 go build -trimpath \
39+
RUN CGO_ENABLED=1 CGO_CFLAGS="${CGO_CFLAGS}" go build -trimpath \
3940
-ldflags "-X github.com/strahe/synaps3/internal/buildinfo.Version=${VERSION} \
4041
-X github.com/strahe/synaps3/internal/buildinfo.Commit=${COMMIT} \
4142
-X github.com/strahe/synaps3/internal/buildinfo.Date=${BUILD_DATE}" \

compose.local.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
synaps3:
3+
image: synaps3:local
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
args:
8+
VERSION: local

docs/en/getting-started/docker.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ The container stores runtime data under `/var/lib/synaps3`, exposes the S3 API o
1414
- SSH access if the dashboard is reached from another machine.
1515
- A Calibration wallet you can fund, or use the wallet steps below.
1616

17+
## Choose the Image Source
18+
19+
The default deployment uses the published image from `compose.yaml`. Continue with [Prepare Configuration](#prepare-configuration) to use it.
20+
21+
### Build the Image from Source
22+
23+
Install Git, then clone the full source tree and build the image:
24+
25+
```bash
26+
git clone https://github.com/strahe/SynapS3.git
27+
cd SynapS3
28+
docker compose -f compose.yaml -f compose.local.yaml build --no-cache
29+
```
30+
31+
When using the local image, skip the deployment directory and download commands in the next section. For every later command in this guide, replace `docker compose` with `docker compose -f compose.yaml -f compose.local.yaml`.
32+
1733
## Prepare Configuration
1834

1935
Create a deployment directory with the Compose file:

docs/zh/getting-started/docker.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ description: 使用 Docker Compose 部署 SynapS3。
1414
- 如果从另一台机器访问仪表盘,需要 SSH 权限。
1515
- 可充值的 Calibration 钱包,或按下面步骤生成并充值。
1616

17+
## 选择镜像来源
18+
19+
默认部署使用 `compose.yaml` 中的发布镜像。使用发布镜像时,继续执行[准备配置](#准备配置)
20+
21+
### 从源码构建镜像
22+
23+
需要在本地构建镜像时,先安装 Git,再克隆完整源码并构建:
24+
25+
```bash
26+
git clone https://github.com/strahe/SynapS3.git
27+
cd SynapS3
28+
docker compose -f compose.yaml -f compose.local.yaml build --no-cache
29+
```
30+
31+
使用本地镜像时,跳过下一节创建部署目录和下载文件的命令。执行本文后续命令时,将开头的 `docker compose` 替换为 `docker compose -f compose.yaml -f compose.local.yaml`
32+
1733
## 准备配置
1834

1935
创建部署目录,并下载 Compose 文件:

0 commit comments

Comments
 (0)