Skip to content

Instantly share code, notes, and snippets.

@snowdream
Created December 17, 2019 08:26
Show Gist options
  • Save snowdream/3d58122ad85c3ac8a86e5815a3b3d32e to your computer and use it in GitHub Desktop.
Save snowdream/3d58122ad85c3ac8a86e5815a3b3d32e to your computer and use it in GitHub Desktop.
FROM centos:latest
LABEL maintainer="snowdream <sn0wdr1am@icloud.com>"
ENV CPULIMIT_VERSION 0.2
ENV XMRIG_VERSION 5.3.0
RUN dnf groupinstall -y 'Development Tools' \
&& dnf install -y wget \
&& cd /root \
&& wget --no-check-certificate -c https://github.com/opsengine/cpulimit/archive/v${CPULIMIT_VERSION}.tar.gz \
&& tar zxvf v${CPULIMIT_VERSION}.tar.gz \
&& cd cpulimit-${CPULIMIT_VERSION} \
&& make \
&& cp src/cpulimit /usr/bin/ \
&& cd /root \
&& wget --no-check-certificate -c https://github.com/C3Pool/profit-switching-miner/blob/master/xmrig-${XMRIG_VERSION}-profit-switching-Linux.tar.gz?raw=true -O xmrig-${XMRIG_VERSION}-profit-switching-Linux.tar.gz \
&& tar zxvf xmrig-${XMRIG_VERSION}-profit-switching-Linux.tar.gz \
&& cd xmrig-${XMRIG_VERSION}-prifit-switching-Linux \
&& cp xmrig /usr/bin/ \
&& mkdir -p /etc/xmrig \
&& cp config.json /etc/xmrig \
&& sed -i "s/YOUR_WALLET_ADDRESS/46PtMFqfymhcHchS7vwjwoMm9v8jyvK6xMZKygZh8nk3LLoRg4jq7sKa9c22bXvfQ8KWogR1DETzVTsAuGffjaBtHVPZ4gs/g" /etc/xmrig/config.json\
&& cd /root \
&& rm v${CPULIMIT_VERSION}.tar.gz \
&& rm -rf cpulimit-${CPULIMIT_VERSION} \
&& rm xmrig-${XMRIG_VERSION}-profit-switching-Linux.tar.gz \
&& rm -rf xmrig-${XMRIG_VERSION}-prifit-switching-Linux \
&& dnf group remove -y 'Development Tools' \
&& dnf clean all
ENTRYPOINT /usr/bin/xmrig -c /etc/xmrig/config.json
@snowdream
Copy link
Author

docker build -t xmr .

docker run --restart=always --network host --name xmr -d xmr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment