mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
build: add dockerfile (#688)
* add dockerfile * add dockerfile * using alpine as release image
This commit is contained in:
committed by
GitHub
parent
babf73612f
commit
140791c901
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
# Use rust image as the builder base
|
||||
FROM rust:1.66.0-bullseye AS builder
|
||||
|
||||
# Set the build profile to be release
|
||||
ARG BUILD_PROFILE=release
|
||||
ENV BUILD_PROFILE $BUILD_PROFILE
|
||||
|
||||
# Update and install dependencies
|
||||
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config
|
||||
|
||||
# Copy base folder into docker context
|
||||
COPY . reth
|
||||
|
||||
# Build reth
|
||||
RUN cd reth && cargo build --all --profile release
|
||||
|
||||
# Use alpine as the release image
|
||||
FROM frolvlad/alpine-glibc
|
||||
|
||||
RUN apk add --no-cache linux-headers
|
||||
|
||||
# Copy the built reth binary from the previous stage
|
||||
COPY --from=builder /reth/target/release/reth /usr/local/bin/reth
|
||||
|
||||
CMD ["/usr/local/bin/reth"]
|
||||
Reference in New Issue
Block a user