xmrig: Init at 6.2.2

This commit is contained in:
Matt Smith 2020-06-29 14:45:14 +01:00
parent 49be028e23
commit 0537671a34
No known key found for this signature in database
GPG key ID: D0EAC8943FB1B2C1
5 changed files with 193 additions and 0 deletions

View file

@ -1,2 +1,5 @@
# docker-monero # docker-monero
### Images
* [`xmrig`](xmrig): XMRig miner

100
xmrig/Dockerfile Normal file
View file

@ -0,0 +1,100 @@
ARG LIBUV_VERSION=1.38.0
ARG OPENSSL_VERSION=1.1.1g
ARG HWLOC_VERSION=2.2.0
ARG XMRIG_VERSION=6.2.2
FROM alpine:3.12 AS builder
ARG LIBUV_VERSION
ARG OPENSSL_VERSION
ARG HWLOC_VERSION
ARG XMRIG_VERSION
RUN apk add --no-cache \
autoconf \
automake \
build-base \
cmake \
libtool \
linux-headers \
m4
# Build OpenSSL.
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 hwloc
WORKDIR /workdir/hwloc
ADD https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.gz \
hwloc-${HWLOC_VERSION}.tar.gz
RUN tar xvf hwloc-${HWLOC_VERSION}.tar.gz
WORKDIR hwloc-${HWLOC_VERSION}
RUN ./configure \
--disable-dependency-tracking \
--disable-io \
--disable-libudev \
--disable-libxml2 \
--disable-shared \
--enable-static \
&& make -j$(nproc) \
&& make install
# Build libuv
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.
WORKDIR /workdir/xmrig
ADD https://github.com/xmrig/xmrig/archive/v${XMRIG_VERSION}.tar.gz \
xmrig-${XMRIG_VERSION}.tar.gz
RUN tar xvf xmrig-${XMRIG_VERSION}.tar.gz
WORKDIR xmrig-${XMRIG_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 \
-DWITH_OPENCL=Off \
-DWITH_CUDA=Off \
&& make \
-Cbuild \
-j$(nproc)
FROM scratch
ARG XMRIG_VERSION
LABEL maintainer="Matt Smith <matt@offtopica.uk>"
COPY --from=builder /workdir/xmrig/xmrig-${XMRIG_VERSION}/build/xmrig /xmrig
ENTRYPOINT ["/xmrig"]

38
xmrig/README.md Normal file
View file

@ -0,0 +1,38 @@
# xmrig
Docker image for the [XMRig Monero miner][xmrig-gh].
### Features
* TLS with OpenSSL.
* Donation level defaults to zero. [Please send Mr XMRig some coins if you can][xmrig-donations].
* Single static binary. No BS.
### Usage Example
```
docker run \
--rm \
-i \
-t \
moneromint/xmrig \
-a rx/0 \
-o xmrpow.de:4242 \
-u YOUR_WALLET_ADDRESS \
```
### Performance Notes
Enable huge pages and apply the MSR tweaks from the host machine; the container is unable to do this.
### Links
* [Docker Hub][dockerhub]
* [git.wownero.com][gitwow]
* [GitHub][github]
[dockerhub]: https://hub.docker.com/r/moneromint/xmrig 'Docker Hub page'
[github]: https://github.com/moneormint/docker-monero 'GitHub repository'
[gitwow]: https://git.wownero.com/asymptotically/docker-monero 'Wownero Git repository'
[xmrig-gh]: https://github.com/xmrig/xmrig 'XMRig GitHub page'
[xmrig-donations]: https://github.com/xmrig/xmrig#donations 'XMRig donation addresses'

View file

@ -0,0 +1,25 @@
From 688b2a9f0eb7f949e25b0e98ad5f0ab8a198713f Mon Sep 17 00:00:00 2001
From: Matt Smith <matt@offtopica.uk>
Date: Mon, 29 Jun 2020 14:23:46 +0100
Subject: [PATCH 1/2] Remove __DATE__ in version message
---
src/base/kernel/Entry.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/base/kernel/Entry.cpp b/src/base/kernel/Entry.cpp
index ae2ac3ce..24ac5b99 100644
--- a/src/base/kernel/Entry.cpp
+++ b/src/base/kernel/Entry.cpp
@@ -51,7 +51,7 @@ namespace xmrig {
static int showVersion()
{
- printf(APP_NAME " " APP_VERSION "\n built on " __DATE__
+ printf(APP_NAME " " APP_VERSION
# if defined(__clang__)
" with clang " __clang_version__);
--
2.27.0

View file

@ -0,0 +1,27 @@
From 285171cdbfd4f56fd70049c4f6eacde6405f88f9 Mon Sep 17 00:00:00 2001
From: Matt Smith <matt@offtopica.uk>
Date: Mon, 29 Jun 2020 14:24:46 +0100
Subject: [PATCH 2/2] Set default donate level to 0
---
src/donate.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/donate.h b/src/donate.h
index 9323dcab..7a2b1996 100644
--- a/src/donate.h
+++ b/src/donate.h
@@ -44,8 +44,8 @@
* XMR: 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD
* BTC: 1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT
*/
-constexpr const int kDefaultDonateLevel = 1;
-constexpr const int kMinimumDonateLevel = 1;
+constexpr const int kDefaultDonateLevel = 0;
+constexpr const int kMinimumDonateLevel = 0;
#endif /* XMRIG_DONATE_H */
--
2.27.0