1414#
1515
1616# Build stage
17- FROM ubuntu:24 .04 AS builder
17+ FROM ubuntu:22 .04 AS builder
1818
1919LABEL maintainer="Webb Developers <dev@webb.tools>"
2020LABEL description="Tangle Network Builder"
2121
2222# Install dependencies required for building
23- RUN apt-get update && \
24- apt-get install -y --no-install-recommends \
25- curl \
26- ca-certificates \
27- git \
28- build-essential \
29- clang \
30- cmake \
31- pkg-config \
32- libssl-dev \
23+ RUN apt-get update && apt-get install -y --no-install-recommends \
24+ curl ca-certificates git build-essential \
25+ clang cmake pkg-config libssl-dev \
3326 && rm -rf /var/lib/apt/lists/*
3427
3528# Install Rust
3629RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
3730ENV PATH="/root/.cargo/bin:${PATH}"
3831
39- # Clone the repository
32+ # Copy the source code
4033WORKDIR /build
4134COPY . /build
4235
4336# Build the Tangle binary
4437RUN cargo build --release
4538
46- # Run stage - using the same Ubuntu version to ensure binary compatibility
47- FROM ubuntu:24.04
39+ # Verify the binary works in this environment
40+ RUN /build/target/release/tangle --version
41+
42+ # Run stage - using the same Ubuntu 22.04 to ensure binary compatibility
43+ FROM ubuntu:22.04
4844
4945LABEL maintainer="Webb Developers <dev@webb.tools>"
5046LABEL description="Tangle Network Node"
@@ -62,7 +58,9 @@ RUN useradd -m -u 5000 -U -s /bin/sh -d /tangle tangle && \
6258 mkdir -p /data /tangle/.local/share && \
6359 chown -R tangle:tangle /data && \
6460 ln -s /data /tangle/.local/share/tangle && \
65- # Check if executable works in this container
61+ # unclutter and minimize the attack surface
62+ rm -rf /usr/bin /usr/sbin && \
63+ # Verify the binary works in the final container
6664 /usr/local/bin/tangle --version
6765
6866USER tangle
0 commit comments