new build process

This commit is contained in:
squidbear
2025-03-25 09:09:39 +01:00
parent 3265446bd9
commit b6d3e39df6
2 changed files with 78 additions and 0 deletions

27
sonic/Dockerfile.sonic Normal file
View File

@@ -0,0 +1,27 @@
FROM golang:1.22 as builder
ARG VERSION
ARG REPO
RUN apt-get update && apt-get install -y git musl-dev make
RUN cd /go && git clone ${REPO:-https://github.com/0xsoniclabs/sonic.git} sonic && cd sonic && git fetch --tags && git checkout -b ${VERSION} tags/${VERSION}
WORKDIR /go/sonic
ARG GOPROXY
RUN go mod download
RUN make all
FROM golang:1.22
COPY --from=builder /go/sonic/build/sonicd /usr/local/bin/
COPY --from=builder /go/sonic/build/sonictool /usr/local/bin/
COPY ./entrypoint.sh entrypoint.sh
EXPOSE 18545 18546 5050 5050/udp
VOLUME /var/sonic
ENTRYPOINT ["/go/sonic/entrypoint.sh"]