-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a second Dockerfile.bundled which bundles third-party binar…
…ies (#77) * feat: add a second Dockerfile.bundled which bundles third-party binaries to run with rindexer * fix: rename Dockerfile.bundled to bundled.Dockerfile * fix: copy ssl certs from builder * feat: don't strip binaries * fix: install foundry into image
- Loading branch information
Showing
3 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
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
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,26 +1,13 @@ | ||
FROM --platform=linux/amd64 rust:1.79-slim-bookworm as builder | ||
FROM --platform=linux/amd64 clux/muslrust:stable as builder | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
RUN apt update && apt install -y libssl-dev binutils libc-dev libstdc++6 pkg-config | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY . . | ||
RUN cargo build --release | ||
RUN strip /app/target/release/rindexer_cli | ||
|
||
FROM --platform=linux/amd64 node:lts-bookworm as node-builder | ||
RUN apt update && apt install -y ca-certificates | ||
WORKDIR /app | ||
COPY . . | ||
RUN cd /app/graphql && npm i && npm run build-linux | ||
|
||
FROM --platform=linux/amd64 debian:bookworm-slim | ||
RUN apt update \ | ||
&& apt install -y libssl-dev libc-dev libstdc++6 ca-certificates lsof \ | ||
&& apt-get autoremove --yes \ | ||
&& apt-get clean --yes \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN RUSTFLAGS='-C target-cpu=native' cargo build --release --target x86_64-unknown-linux-musl --features jemalloc | ||
|
||
COPY --from=node-builder /app/core/resources/rindexer-graphql-linux /app/resources/rindexer-graphql-linux | ||
COPY --from=builder /app/target/release/rindexer_cli /app/rindexer | ||
FROM --platform=linux/amd64 scratch | ||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/rindexer_cli /app/rindexer | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
ENTRYPOINT ["/app/rindexer"] |
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,28 @@ | ||
FROM --platform=linux/amd64 rust:1.79-slim-bookworm as builder | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
RUN apt update && apt install -y libssl-dev pkg-config build-essential | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN RUSTFLAGS='-C target-cpu=native' cargo build --release --features jemalloc | ||
|
||
FROM --platform=linux/amd64 node:lts-bookworm as node-builder | ||
RUN apt update && apt install -y ca-certificates | ||
WORKDIR /app | ||
COPY . . | ||
RUN cd /app/graphql && npm i && npm run build-linux | ||
|
||
FROM --platform=linux/amd64 debian:bookworm-slim | ||
RUN apt update \ | ||
&& apt install -y libssl-dev libc-dev libstdc++6 ca-certificates lsof curl git \ | ||
&& apt-get autoremove --yes \ | ||
&& apt-get clean --yes \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -L https://foundry.paradigm.xyz | bash | ||
RUN /root/.foundry/bin/foundryup | ||
|
||
COPY --from=node-builder /app/core/resources/rindexer-graphql-linux /app/resources/rindexer-graphql-linux | ||
COPY --from=builder /app/target/release/rindexer_cli /app/rindexer | ||
|
||
ENTRYPOINT ["/app/rindexer"] |