Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 277f98d

Browse files
authored
Merge pull request #1 from chainstack/feature/INFRA-3798
create docker for fantom with sonic client
2 parents 5f0ba45 + fd9c817 commit 277f98d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Build stage
2+
FROM golang:1.22 as builder
3+
4+
# Set working directory
5+
WORKDIR /tmp
6+
7+
# Install dependencies
8+
#RUN apk add --no-cache make gcc musl-dev linux-headers git
9+
RUN apt-get update && apt-get install -y git musl-dev make
10+
11+
# Clean the Go module cache
12+
RUN go clean -modcache
13+
14+
# Clone the specific branch of the Sonic repository and build the application
15+
RUN git clone --depth 1 --branch v1.2.1-f https://github.com/Fantom-foundation/Sonic.git && \
16+
cd Sonic && \
17+
make all
18+
19+
# Final stage
20+
FROM alpine:latest
21+
22+
# Set working directory
23+
WORKDIR /root/.sonic
24+
25+
# Install ca-certificates for HTTPS
26+
RUN apk add --no-cache ca-certificates curl jq
27+
28+
# Copy binaries from builder stage
29+
COPY --from=builder /tmp/Sonic/build/sonicd /usr/local/bin/
30+
COPY --from=builder /tmp/Sonic/build/sonictool /usr/local/bin/
31+
32+
# Create a non-root user
33+
RUN adduser -D -u 1000 sonic
34+
35+
# Switch to non-root user
36+
USER sonic
37+
38+
# Expose necessary ports
39+
EXPOSE 5050 5050/udp 80 18546 18545
40+
41+
# Set the entrypoint (default to running sonicd, but can be overridden)
42+
ENTRYPOINT ["sonicd"]

0 commit comments

Comments
 (0)