FROM rust:1.93.0-slim-bullseye
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
clang \
libclang-dev \
libssl-dev \
zlib1g-dev \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=noninteractive
# Work in a workspace-friendly directory
WORKDIR /workspace
# Copy source code
COPY . .
# Build the fuel-core binary from source
# Try to install the binary directly to simplify path assumptions
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
cargo install --path bin/fuel-core --locked
# Expose the default Fuel Core GraphQL / RPC port (optional for running tests)
EXPOSE 4000
EXPOSE 4000/tcp
# Run the binary by default. Use "fuel-core run" subcommand to start, with in-memory DB for portability.
CMD ["fuel-core", "run", "--db-type", "in-memory"]
# Ignore VCS metadata and dependencies .git .gitignore node_modules/ build/ target/ **/*.pyc **/*.o **/*.rlib # Cargo related caches /target /.cargo
Build timed out after 600s
FROM rust:1.93.0-slim-bullseye
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
clang \
libclang-dev \
libssl-dev \
zlib1g-dev \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=noninteractive
# Build from source in a dedicated workspace
WORKDIR /workspace
# Copy source code
COPY . .
# Build the fuel-core binary from source
RUN cargo build --release -p fuel-core-bin
# Expose the default Fuel Core GraphQL / RPC port (optional for running tests)
EXPOSE 4000
# Copy the built binary to a standard location and ensure it's in PATH
RUN cp /workspace/target/release/fuel-core-bin /usr/local/bin/fuel-core-bin
# Default command to run Fuel Core in in-memory mode for lightweight runs
CMD ["fuel-core-bin", "run", "--db-type", "in-memory"]