Skip to content

Commit 5d74eee

Browse files
committed
move Dockerfile to the right folder
1 parent a6f68bd commit 5d74eee

File tree

3 files changed

+41
-23
lines changed

3 files changed

+41
-23
lines changed

Dockerfile

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
# Use a specific nightly toolchain for reproducible builds
2-
FROM rustlang/rust@sha256:04690ffa09cddd358b349272173155319f384e57816614eea0840ec7f9422862
1+
FROM rust:bookworm AS build
32

4-
# Set the working directory for building
5-
WORKDIR /build
3+
ARG STACKS_NODE_VERSION="No Version Info"
4+
ARG GIT_BRANCH='No Branch Info'
5+
ARG GIT_COMMIT='No Commit Info'
66

7-
# Copy the entire project to build the binaries
7+
WORKDIR /src
88
COPY . .
9+
RUN mkdir /out
10+
RUN rustup toolchain install stable
11+
RUN cargo build --features monitoring_prom,slog_json --release
12+
RUN cp -R target/release/. /out
913

10-
# Pre-build the config-docs-generator binaries during image build
11-
RUN cargo build --package config-docs-generator --release
12-
13-
# Set the working directory where the project will be mounted at runtime
14-
WORKDIR /project_root
15-
16-
# Set environment variables for generate-config-docs.sh
17-
ENV PROJECT_ROOT=/project_root
18-
ENV BUILD_ROOT=/build
19-
ENV CARGO_HOME=/project_root/.cargo
20-
ENV EXTRACT_DOCS_BIN=/build/target/release/extract-docs
21-
ENV GENERATE_MARKDOWN_BIN=/build/target/release/generate-markdown
22-
ENV SKIP_BUILD=true
23-
24-
# Set the entrypoint to run the config docs generation script
25-
ENTRYPOINT ["/build/contrib/tools/config-docs-generator/generate-config-docs.sh"]
14+
FROM debian:bookworm-slim
15+
COPY --from=build /out/stacks-node /out/stacks-signer /out/stacks-inspect /bin/
16+
CMD ["stacks-node", "mainnet"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use a specific nightly toolchain for reproducible builds
2+
FROM rustlang/rust@sha256:04690ffa09cddd358b349272173155319f384e57816614eea0840ec7f9422862
3+
4+
# Set the working directory for building
5+
WORKDIR /build
6+
7+
# Copy the entire project root to preserve structure
8+
# Copy from three levels up (project root) to maintain the directory structure
9+
COPY ../../../ /build
10+
11+
# Pre-build the config-docs-generator binaries during image build
12+
RUN cargo build --package config-docs-generator --release
13+
14+
# Set the working directory where the project will be mounted at runtime
15+
WORKDIR /project_root
16+
17+
# Set environment variables for generate-config-docs.sh
18+
ENV PROJECT_ROOT=/project_root
19+
ENV BUILD_ROOT=/build
20+
ENV CARGO_HOME=/project_root/.cargo
21+
ENV EXTRACT_DOCS_BIN=/build/target/release/extract-docs
22+
ENV GENERATE_MARKDOWN_BIN=/build/target/release/generate-markdown
23+
ENV SKIP_BUILD=true
24+
25+
# Set the entrypoint to run the config docs generation script
26+
# The script ends up at /build/generate-config-docs.sh due to the copy operation
27+
ENTRYPOINT ["/build/generate-config-docs.sh"]

contrib/tools/config-docs-generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The easiest way to generate configuration documentation:
1313
docker build -t config-docs-generator .
1414

1515
# Generate documentation
16-
docker run --rm -v "$(pwd):/project_root" --user "$(id -u):$(id -g)" config-docs-generator
16+
docker run --rm -v "$(pwd)/../../../:/project_root" config-docs-generator
1717
```
1818

1919
This approach:
@@ -117,7 +117,7 @@ fn struct_to_section_name(struct_name: &str) -> String {
117117

118118
```bash
119119
# Using Docker (recommended)
120-
docker run --rm -v "$(pwd):/project_root" --user "$(id -u):$(id -g)" config-docs-generator
120+
docker run --rm -v "$(pwd)/../../../:/project_root" config-docs-generator
121121

122122
# OR using local setup
123123
./contrib/tools/config-docs-generator/generate-config-docs.sh

0 commit comments

Comments
 (0)