docker-monero/xmrig-proxy/Dockerfile
2020-07-17 10:31:32 +01:00

78 lines
1.9 KiB
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"]