1
- FROM docker.io/library/ golang:1.23 AS builder
1
+ FROM golang:1.23 AS builder
2
2
3
3
WORKDIR /hostd
4
4
@@ -11,29 +11,24 @@ COPY . .
11
11
# codegen
12
12
RUN go generate ./...
13
13
# build
14
- RUN CGO_ENABLED=1 go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
14
+ RUN CGO_ENABLED=1 go build -o bin/ -tags='timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
15
15
16
- FROM scratch
16
+ FROM debian:bookworm-slim
17
17
18
18
LABEL maintainer="The Sia Foundation <info@sia.tech>" \
19
- org.opencontainers.image.description.vendor="The Sia Foundation" \
20
- org.opencontainers.image.description="A hostd container - provide storage on the Sia network and earn Siacoin" \
21
- org.opencontainers.image.source="https://github.com/SiaFoundation/hostd" \
22
- org.opencontainers.image.licenses=MIT
19
+ org.opencontainers.image.description.vendor="The Sia Foundation" \
20
+ org.opencontainers.image.description="A hostd container - provide storage on the Sia network and earn Siacoin" \
21
+ org.opencontainers.image.source="https://github.com/SiaFoundation/hostd" \
22
+ org.opencontainers.image.licenses=MIT
23
23
24
- ENV PUID=0
25
- ENV PGID=0
24
+ # copy binary and certificates
25
+ COPY --from=builder /hostd/bin/* /usr/bin/
26
+ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
26
27
27
- ENV HOSTD_API_PASSWORD=
28
- ENV HOSTD_WALLET_SEED=
29
28
ENV HOSTD_DATA_DIR=/data
30
29
ENV HOSTD_CONFIG_FILE=/data/hostd.yml
31
30
32
- # copy binary and prepare data dir.
33
- COPY --from=builder /hostd/bin/* /usr/bin/
34
- COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
35
31
VOLUME [ "/data" ]
36
-
37
32
# API port
38
33
EXPOSE 9980/tcp
39
34
# RPC port
@@ -42,7 +37,7 @@ EXPOSE 9981/tcp
42
37
EXPOSE 9982/tcp
43
38
# RHP3 TCP port
44
39
EXPOSE 9983/tcp
45
-
46
- USER ${PUID}:${PGID}
40
+ # RHP4 TCP port
41
+ EXPOSE 9984/tcp
47
42
48
43
ENTRYPOINT [ "hostd" , "--env" , "--http" , ":9980" ]
0 commit comments