Skip to content

Commit b717c99

Browse files
author
Roman
committed
Add Dockerfile-localnet
1 parent 15b64fc commit b717c99

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Dockerfile-localnet

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ LABEL ai.opentensor.image.authors="[email protected]" \
1515
# Set up Rust environment
1616
ENV RUST_BACKTRACE=1
1717

18-
RUN apt-get update && \
19-
apt-get install -y curl build-essential protobuf-compiler clang git pkg-config libssl-dev llvm libudev-dev
20-
#RUN rm -rf /var/lib/apt/lists/*
18+
RUN apt-get update
19+
RUN apt-get install -y curl build-essential protobuf-compiler clang git pkg-config libssl-dev llvm libudev-dev
2120

2221
# Copy entire repository
2322
COPY . /build
@@ -32,34 +31,35 @@ RUN rustup target add wasm32-unknown-unknown
3231
## Build fast-blocks node
3332
RUN ./scripts/localnet.sh --build-only
3433
# Build non-fast-blocks
35-
#RUN ./scripts/localnet.sh False --build-only
34+
RUN ./scripts/localnet.sh False --build-only
3635

3736
# Verify the binaries was produced
3837
RUN test -e /build/target/fast-blocks/release/node-subtensor
39-
#RUN test -e /build/target/non-fast-blocks/release/node-subtensor
40-
41-
EXPOSE 30333 9933 9944 9945
38+
RUN test -e /build/target/non-fast-blocks/release/node-subtensor
4239

4340
FROM $BASE_IMAGE AS subtensor-localnet
4441

4542
# Copy binaries
4643
COPY --from=builder /build/target/fast-blocks/release/node-subtensor target/fast-blocks/release/node-subtensor
4744
RUN chmod +x target/fast-blocks/release/node-subtensor
4845

49-
#COPY --from=builder /build/target/non-fast-blocks/release/node-subtensor target/non-fast-blocks/release/node-subtensor
50-
#RUN chmod +x target/non-fast-blocks/release/node-subtensor
46+
COPY --from=builder /build/target/non-fast-blocks/release/node-subtensor target/non-fast-blocks/release/node-subtensor
47+
RUN chmod +x target/non-fast-blocks/release/node-subtensor
5148

5249
COPY --from=builder /build/snapshot.json /snapshot.json
5350

5451
COPY --from=builder /build/scripts/localnet.sh scripts/localnet.sh
5552
RUN chmod +x /scripts/localnet.sh
5653

57-
# Ubdate certificates
58-
RUN apt install ca-certificates
59-
RUN update-ca-certificates
54+
## Ubdate certificates
55+
RUN apt-get update && apt-get install -y ca-certificates
6056

6157
# Do not build (just run)
6258
ENV BUILD_BINARY=0
59+
# Switch to local run with IP 0.0.0.0 within docker image
60+
ENV RUN_IN_DOCKER=1
61+
# Expose ports
62+
EXPOSE 30334 30335 9944 9945
6363

6464
ENTRYPOINT ["/scripts/localnet.sh"]
65-
CMD ["True"]
65+
CMD ["True"]

0 commit comments

Comments
 (0)