Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jul 5, 2024
1 parent d99cb63 commit 079fbe3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is an example build stage for the node template. Here we create the binary in a temporary image.

# This is a base image to build substrate nodes
FROM ubuntu:22.04 as builder
FROM ubuntu:22.04 AS builder

ARG PROFILE=production

Expand All @@ -18,26 +18,30 @@ RUN \
clang \
cmake \
make && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown
# RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY . .
# This resolves the warning: subcoin-node@0.1.0: Could not find `.git/HEAD` searching from `/subcoin/crates/subcoin-node` upwards!
COPY ./.git .git

RUN cargo build --locked --profile=production
RUN /root/.cargo/bin/cargo build --locked --profile=$PROFILE

# This is the 2nd stage: a very small image where we copy the binary."
FROM docker.io/library/ubuntu:22.04
LABEL description="Multistage Docker image for Substrate Node Template" \
LABEL description="Multistage Docker image for Subcoin Node" \
image.type="builder" \
image.authors="you@email.com" \
image.vendor="Substrate Developer Hub" \
image.description="Multistage Docker image for Substrate Node Template" \
image.source="https://github.com/substrate-developer-hub/substrate-subcoin" \
image.documentation="https://github.com/substrate-developer-hub/substrate-subcoin"
image.authors="xuliuchengxlc@email.com" \
image.vendor="Subcoin Contributors" \
image.description="Multistage Docker image for Subnode Node" \
image.source="https://github.com/subcoin-project/subcoin" \
image.documentation="https://subcoin-project.github.io/subcoin"

ARG PROFILE=production

# Copy the node binary.
COPY --from=builder /subcoin/target/production/subcoin /usr/local/bin
COPY --from=builder /subcoin/target/$PROFILE/subcoin /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh -d /node-dev node-dev && \
mkdir -p /chain-data /node-dev/.local/share && \
Expand All @@ -46,7 +50,7 @@ RUN useradd -m -u 1000 -U -s /bin/sh -d /node-dev node-dev && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/subcoin --version
/usr/local/bin/subcoin --help

USER node-dev

Expand Down
2 changes: 1 addition & 1 deletion crates/subcoin-node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sc_service::PartialComponents;

#[derive(Debug, clap::Subcommand)]
pub enum Command {
/// Import blocks.
/// Import blocks from bitcoind database.
ImportBlocks(ImportBlocks),

/// Validate blocks.
Expand Down

0 comments on commit 079fbe3

Please sign in to comment.