tor-relay
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
f9b904b4f2
commit
c4b213cbb7
|
@ -1,4 +1,4 @@
|
||||||
# Stage 1: Build Tor from source on Alpine Linux
|
# Stage 1: Build Tor statically on Alpine Linux
|
||||||
FROM alpine:latest AS builder
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
# Install necessary dependencies
|
# Install necessary dependencies
|
||||||
|
@ -15,28 +15,50 @@ RUN apk update && \
|
||||||
autoconf \
|
autoconf \
|
||||||
libtool
|
libtool
|
||||||
|
|
||||||
# Download and compile Tor
|
# Create working directory
|
||||||
|
WORKDIR /tmp/static_tor
|
||||||
|
RUN mkdir install
|
||||||
|
|
||||||
|
# Compile libevent
|
||||||
|
RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz && \
|
||||||
|
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 install && \
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Compile OpenSSL
|
||||||
|
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 install && \
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Compile zlib
|
||||||
|
RUN wget http://zlib.net/zlib-1.2.11.tar.gz && \
|
||||||
|
tar xf zlib-1.2.11.tar.gz && \
|
||||||
|
cd zlib-1.2.11 && \
|
||||||
|
./configure --static --prefix=/tmp/static_tor/install && \
|
||||||
|
make -j4 && \
|
||||||
|
make install && \
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Compile Tor
|
||||||
RUN git clone https://git.torproject.org/tor.git && \
|
RUN git clone https://git.torproject.org/tor.git && \
|
||||||
cd tor && \
|
cd tor && \
|
||||||
|
git checkout tor-0.4.7.7 && \
|
||||||
./autogen.sh && \
|
./autogen.sh && \
|
||||||
./configure && \
|
./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 && \
|
make -j4
|
||||||
make install
|
|
||||||
|
|
||||||
# Stage 2: Create the final minimal image with Tor
|
# Stage 2: Create the final minimal image with Tor
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
# Copy necessary files from the builder stage
|
# Copy the statically compiled Tor binary
|
||||||
COPY --from=builder /usr/local/bin/tor /usr/local/bin/tor
|
COPY --from=builder /tmp/static_tor/tor/src/or/tor /usr/local/bin/tor
|
||||||
COPY --from=builder /usr/local/etc/tor /usr/local/etc/tor
|
|
||||||
COPY --from=builder /etc/ssl /etc/ssl
|
|
||||||
COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1
|
|
||||||
COPY --from=builder /lib/libevent-2.1.so.6 /lib/libevent-2.1.so.6
|
|
||||||
COPY --from=builder /lib/libssl.so.1.1 /lib/libssl.so.1.1
|
|
||||||
COPY --from=builder /lib/libcrypto.so.1.1 /lib/libcrypto.so.1.1
|
|
||||||
COPY --from=builder /lib/libz.so.1 /lib/libz.so.1
|
|
||||||
COPY --from=builder /lib/libgcc_s.so.1 /lib/libgcc_s.so.1
|
|
||||||
COPY --from=builder /lib/libc.musl-x86_64.so.1 /lib/libc.musl-x86_64.so.1
|
|
||||||
|
|
||||||
# Copy the torrc configuration file
|
# Copy the torrc configuration file
|
||||||
COPY torrc /usr/local/etc/tor/torrc
|
COPY torrc /usr/local/etc/tor/torrc
|
||||||
|
|
Loading…
Reference in New Issue