forked from commune-ai/subspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3f6622
commit acd05e1
Showing
2 changed files
with
15 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.git | ||
.devcontainer | ||
.github | ||
.vscode | ||
target | ||
specs | ||
snapshot | ||
snapshot |
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,34 +1,18 @@ | ||
# **NOTE**: This docker file expects to be run in a directory outside of subspace. | ||
# It also expects two build arguments, the bittensor snapshot directory, and the bittensor | ||
# snapshot file name. | ||
FROM rust:1.75-bookworm as build-env | ||
|
||
# This runs typically via the following command: | ||
# $ docker build -t subspace . --platform linux/x86_64 --build-arg SNAPSHOT_DIR="DIR_NAME" --build-arg SNAPSHOT_FILE="FILENAME.TAR.GZ" -f subspace/Dockerfile | ||
RUN apt-get update | ||
RUN apt-get install -y clang protobuf-compiler | ||
WORKDIR /app | ||
COPY . /app | ||
RUN cargo build --release | ||
|
||
|
||
FROM ubuntu:22.04 | ||
|
||
# This is being set so that no interactive components are allowed when updating. | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
# Necessary libraries for Rust execution | ||
RUN apt-get update && apt-get install -y curl build-essential protobuf-compiler clang git | ||
|
||
WORKDIR /subspace | ||
|
||
COPY ./scripts ./scripts | ||
# Install cargo and Rust | ||
|
||
RUN apt-get update && apt-get install -y clang | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
RUN ./scripts/install_rust_env.sh | ||
|
||
# Copy the source code | ||
COPY . . | ||
# Cargo build | ||
RUN cargo build --release --locked | ||
|
||
# FROM gcr.io/distroless/cc | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y zlib1g && \ | ||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* | ||
|
||
COPY --from=build-env /app/target/release/node-subspace /usr/local/bin | ||
CMD ["node-subspace"] |