-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from SiaFoundation/nate/docker-base-image
Switch Docker base from scratch to debian:slim
- Loading branch information
Showing
3 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.changeset/switch_docker_base_image_from_scratch_to_debianbookworm_slim.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
default: major | ||
--- | ||
|
||
# Switched Docker base image from scratch to debian:bookworm-slim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM docker.io/library/golang:1.23 AS builder | ||
FROM golang:1.23 AS builder | ||
|
||
WORKDIR /hostd | ||
|
||
|
@@ -11,29 +11,24 @@ COPY . . | |
# codegen | ||
RUN go generate ./... | ||
# build | ||
RUN CGO_ENABLED=1 go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd | ||
RUN CGO_ENABLED=1 go build -o bin/ -tags='timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd | ||
|
||
FROM scratch | ||
FROM debian:bookworm-slim | ||
|
||
LABEL maintainer="The Sia Foundation <[email protected]>" \ | ||
org.opencontainers.image.description.vendor="The Sia Foundation" \ | ||
org.opencontainers.image.description="A hostd container - provide storage on the Sia network and earn Siacoin" \ | ||
org.opencontainers.image.source="https://github.com/SiaFoundation/hostd" \ | ||
org.opencontainers.image.licenses=MIT | ||
org.opencontainers.image.description.vendor="The Sia Foundation" \ | ||
org.opencontainers.image.description="A hostd container - provide storage on the Sia network and earn Siacoin" \ | ||
org.opencontainers.image.source="https://github.com/SiaFoundation/hostd" \ | ||
org.opencontainers.image.licenses=MIT | ||
|
||
ENV PUID=0 | ||
ENV PGID=0 | ||
# copy binary and certificates | ||
COPY --from=builder /hostd/bin/* /usr/bin/ | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
ENV HOSTD_API_PASSWORD= | ||
ENV HOSTD_WALLET_SEED= | ||
ENV HOSTD_DATA_DIR=/data | ||
ENV HOSTD_CONFIG_FILE=/data/hostd.yml | ||
|
||
# copy binary and prepare data dir. | ||
COPY --from=builder /hostd/bin/* /usr/bin/ | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
VOLUME [ "/data" ] | ||
|
||
# API port | ||
EXPOSE 9980/tcp | ||
# RPC port | ||
|
@@ -42,7 +37,7 @@ EXPOSE 9981/tcp | |
EXPOSE 9982/tcp | ||
# RHP3 TCP port | ||
EXPOSE 9983/tcp | ||
|
||
USER ${PUID}:${PGID} | ||
# RHP4 TCP port | ||
EXPOSE 9984/tcp | ||
|
||
ENTRYPOINT [ "hostd", "--env", "--http", ":9980" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters