mirror of
https://git.wownero.com/asymptotically/docker-monero.git
synced 2024-08-15 01:03:28 +00:00
78 lines
1.9 KiB
Docker
78 lines
1.9 KiB
Docker
ARG LIBUV_VERSION=1.38.0
|
||
ARG OPENSSL_VERSION=1.1.1g
|
||
ARG XMRIG_PROXY_VERSION=6.3.0
|
||
|
||
FROM alpine:3.12 AS builder
|
||
|
||
RUN apk add --no-cache \
|
||
autoconf \
|
||
automake \
|
||
build-base \
|
||
cmake \
|
||
libtool \
|
||
linux-headers \
|
||
m4
|
||
|
||
# Build OpenSSL.
|
||
ARG OPENSSL_VERSION
|
||
WORKDIR /workdir/openssl
|
||
ADD https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
|
||
openssl-${OPENSSL_VERSION}.tar.gz
|
||
RUN tar xvf openssl-${OPENSSL_VERSION}.tar.gz
|
||
|
||
WORKDIR openssl-${OPENSSL_VERSION}
|
||
RUN ./config \
|
||
-no-asm \
|
||
-no-cms \
|
||
-no-comp \
|
||
-no-dgram \
|
||
-no-filenames \
|
||
-no-shared \
|
||
-no-zlib \
|
||
&& make -j$(nproc) \
|
||
&& make install_sw
|
||
|
||
# Build libuv
|
||
ARG LIBUV_VERSION
|
||
WORKDIR /workdir/libuv
|
||
ADD https://github.com/libuv/libuv/archive/v${LIBUV_VERSION}.tar.gz \
|
||
libuv-${LIBUV_VERSION}.tar.gz
|
||
RUN tar xvf libuv-${LIBUV_VERSION}.tar.gz
|
||
|
||
WORKDIR libuv-${LIBUV_VERSION}
|
||
RUN ./autogen.sh \
|
||
&& ./configure \
|
||
--disable-shared \
|
||
&& make -j$(nproc) \
|
||
&& make install
|
||
|
||
# Build XMRig Proxy.
|
||
ARG XMRIG_PROXY_VERSION
|
||
WORKDIR /workdir/xmrig-proxy
|
||
ADD https://github.com/xmrig/xmrig-proxy/archive/v${XMRIG_PROXY_VERSION}.tar.gz \
|
||
xmrig-proxy-${XMRIG_PROXY_VERSION}.tar.gz
|
||
RUN tar xvf xmrig-proxy-${XMRIG_PROXY_VERSION}.tar.gz
|
||
|
||
WORKDIR xmrig-proxy-${XMRIG_PROXY_VERSION}
|
||
COPY patches/ patches/
|
||
RUN cat patches/*.patch | patch -p1 \
|
||
&& cmake \
|
||
-Bbuild \
|
||
-DBUILD_STATIC=On \
|
||
-DCMAKE_BUILD_TYPE=Release \
|
||
-DCMAKE_EXE_LINKER_FLAGS='-static -static-libgcc' \
|
||
-DCMAKE_FIND_LIBRARY_SUFFIXES=.a \
|
||
-DOPENSSL_USE_STATIC_LIBS=On \
|
||
&& make \
|
||
-Cbuild \
|
||
-j$(nproc)
|
||
|
||
FROM scratch
|
||
|
||
ARG XMRIG_PROXY_VERSION
|
||
|
||
LABEL maintainer="Matt Smith <matt@offtopica.uk>"
|
||
|
||
COPY --from=builder /workdir/xmrig-proxy/xmrig-proxy-${XMRIG_PROXY_VERSION}/build/xmrig-proxy /xmrig-proxy
|
||
|
||
ENTRYPOINT ["/xmrig-proxy"]
|