Skip to content

Commit d29225e

Browse files
committed
cleanup
1 parent 231d03d commit d29225e

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

docker/Tangle.Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,33 @@
1414
#
1515

1616
# Build stage
17-
FROM ubuntu:24.04 AS builder
17+
FROM ubuntu:22.04 AS builder
1818

1919
LABEL maintainer="Webb Developers <dev@webb.tools>"
2020
LABEL 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
3629
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
3730
ENV PATH="/root/.cargo/bin:${PATH}"
3831

39-
# Clone the repository
32+
# Copy the source code
4033
WORKDIR /build
4134
COPY . /build
4235

4336
# Build the Tangle binary
4437
RUN 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

4945
LABEL maintainer="Webb Developers <dev@webb.tools>"
5046
LABEL 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

6866
USER tangle

0 commit comments

Comments
 (0)