diff --git a/docker/tor-relay/Dockerfile b/docker/tor-relay/Dockerfile index c6289ee..b0f70bf 100644 --- a/docker/tor-relay/Dockerfile +++ b/docker/tor-relay/Dockerfile @@ -27,7 +27,7 @@ RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-s tar xf libevent-2.1.12-stable.tar.gz && \ cd libevent-2.1.12-stable && \ ./configure --disable-shared --enable-static --with-pic --prefix=/tmp/static_tor/install && \ - make -j4 && \ + make -j$(nproc) && \ make install && \ cd .. @@ -36,7 +36,7 @@ RUN wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz && \ tar xf openssl-1.1.1o.tar.gz && \ cd openssl-1.1.1o && \ ./config no-shared no-dso --prefix=/tmp/static_tor/install && \ - make -j4 && \ + make -j$(nproc) && \ make install && \ cd .. @@ -45,7 +45,7 @@ RUN wget https://zlib.net/fossils/zlib-1.2.12.tar.gz && \ tar xf zlib-1.2.12.tar.gz && \ cd zlib-1.2.12 && \ ./configure --static --prefix=/tmp/static_tor/install && \ - make -j4 && \ + make -j$(nproc) && \ make install && \ cd .. @@ -55,17 +55,14 @@ RUN git clone https://git.torproject.org/tor.git && \ git checkout tor-0.4.7.7 && \ ./autogen.sh && \ ./configure --disable-asciidoc --enable-static-tor --with-libevent-dir=/tmp/static_tor/install --with-openssl-dir=/tmp/static_tor/install --with-zlib-dir=/tmp/static_tor/install && \ - make -j4 + make -j$(nproc) -# Debug step: List broader directory contents -RUN ls -l /tmp/static_tor/tor/src -RUN ls -l /tmp/static_tor/tor/src/app +# Stage 2: Create the minimal image with scratch +FROM scratch -# Stage 2: Create the final image for testing with Alpine -FROM alpine:latest - -# Copy the statically compiled Tor binary (adjust path based on debug output) +# Copy the statically compiled Tor binary and libraries COPY --from=builder /tmp/static_tor/tor/src/app/tor /usr/local/bin/tor +COPY --from=builder /tmp/static_tor/install /usr/local # Copy the torrc configuration file COPY torrc /usr/local/etc/tor/torrc