mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
Co-authored-by: colinlyguo <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
27 lines
663 B
Docker
27 lines
663 B
Docker
# Download Go dependencies
|
|
FROM scrolltech/go-alpine-builder:1.18 as base
|
|
|
|
WORKDIR /src
|
|
COPY go.work* ./
|
|
COPY ./bridge/go.* ./bridge/
|
|
COPY ./common/go.* ./common/
|
|
COPY ./coordinator/go.* ./coordinator/
|
|
COPY ./database/go.* ./database/
|
|
COPY ./roller/go.* ./roller/
|
|
COPY ./tests/integration-test/go.* ./tests/integration-test/
|
|
RUN go mod download -x
|
|
|
|
# Build db_cli
|
|
FROM base as builder
|
|
|
|
RUN --mount=target=. \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
cd /src/database/cmd && go build -v -p 4 -o /bin/db_cli
|
|
|
|
# Pull db_cli into a second stage deploy alpine container
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /bin/db_cli /bin/
|
|
|
|
ENTRYPOINT ["db_cli"]
|