diff options
-rw-r--r-- | Dockerfile | 23 | ||||
-rwxr-xr-x | scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh | 85 |
2 files changed, 55 insertions, 53 deletions
@@ -1,35 +1,22 @@ # Latest version of ubuntu -FROM ubuntu +FROM nvidia/cuda:9.0-base # Default git repository ENV GIT_REPOSITORY https://github.com/fireice-uk/xmr-stak.git -ENV CUDA_URL https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run -ENV OPENCL_URL http://pages.cs.wisc.edu/~riccardo/assets/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 - -ENV CMAKE_C_COMPILER gcc-5 -ENV CMAKE_CXX_COMPILER g++-5 ENV XMRSTAK_CMAKE_FLAGS -DXMR-STAK_COMPILE=generic -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF # Innstall packages RUN apt-get update \ && set -x \ - && apt-get install -qq --no-install-recommends -y ca-certificates cmake g++ gcc git libhwloc-dev libmicrohttpd-dev libssl-dev lsb-release wget \ - && wget -q $CUDA_URL \ - && chmod u+x /cuda_*_linux-run \ - && /cuda_*_linux-run --silent --toolkit \ - && wget -q $OPENCL_URL -O - | tar xjf - -C / \ - && /AMD-APP-SDK-*-linux64.sh --keep -- --silent --acceptEULA=yes \ - && . /etc/profile.d/AMDAPPSDK.sh \ + && apt-get install -qq --no-install-recommends -y ca-certificates cmake cuda-core-9-0 git cuda-cudart-dev-9-0 libhwloc-dev libmicrohttpd-dev libssl-dev \ && git clone $GIT_REPOSITORY \ && cd /xmr-stak \ - && cmake -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${XMRSTAK_CMAKE_FLAGS} . \ + && cmake ${XMRSTAK_CMAKE_FLAGS} . \ && make \ && cd - \ && mv /xmr-stak/bin/* /usr/local/bin/ \ - && /AMDAPPSDK*/uninstall.sh \ - && /usr/local/cuda/bin/uninstall_cuda_*.pl > /dev/null \ - && rm -rf /AMD-APP-SDK-*-linux64.sh /AMDAPPSDK* /cuda_*_linux-run /xmr-stak \ - && apt-get purge -y -qq cmake g++ gcc git libhwloc-dev libmicrohttpd-dev libssl-dev lsb-release wget \ + && rm -rf /xmr-stak \ + && apt-get purge -y -qq cmake cuda-core-9-0 git cuda-cudart-dev-9-0 libhwloc-dev libmicrohttpd-dev libssl-dev \ && apt-get clean -qq VOLUME /mnt diff --git a/scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh b/scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh index 540a3f6..bfee1b8 100755 --- a/scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh +++ b/scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh @@ -11,110 +11,125 @@ else git clone https://github.com/fireice-uk/xmr-stak.git fi +wget -c https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run +chmod a+x cuda_*_linux-run + ######################## # Fedora 27 ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak fedora:27 /bin/bash -c " -set -ex ; -dnf install -y -q gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake ; -cd /xmr-stak ; +# CUDA is not going to work on Fedora 27 beacuse it's only support these distributions: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html +docker run --rm -it -v $PWD:/mnt fedora:27 /bin/bash -c " +set -x ; +dnf install -y -q cmake gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel; +cd /mnt/xmr-stak ; cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; make ; " -mv xmr-stak/bin/xmr-stak xmr-stak_fedora_27 +test -d fedora_27 || mkdir fedora_27 +mv xmr-stak/bin/* fedora_27 git -C xmr-stak clean -fd ######################## # Ubuntu (17.04) ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak ubuntu:17.10 /bin/bash -c " -set -ex ; +docker run --rm -it -v $PWD:/mnt ubuntu:17.04 /bin/bash -c " +set -x ; apt update -qq ; apt install -y -qq libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev ; -cd /xmr-stak ; -cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; +cd /mnt/xmr-stak ; +/mnt/cuda_*_linux-run --silent --toolkit ; +cmake -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF . ; make ; " -mv xmr-stak/bin/xmr-stak xmr-stak_ubuntu_17.10 +test -d ubuntu_17.10 || mkdir ubuntu_17.10 +mv xmr-stak/bin/* ubuntu_17.10 git -C xmr-stak clean -fd ######################## # Ubuntu 16.04 ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak ubuntu:16.04 /bin/bash -c " -set -ex ; +docker run --rm -it -v $PWD:/mnt ubuntu:16.04 /bin/bash -c " +set -x ; apt update -qq ; -apt install -y -qq libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev ; -cd /xmr-stak ; -cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; +apt install -y -qq cmake g++ libmicrohttpd-dev libssl-dev libhwloc-dev ; +cd /mnt/xmr-stak ; +/mnt/cuda_*_linux-run --silent --toolkit ; +cmake -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF . ; make ; " -mv xmr-stak/bin/xmr-stak xmr-stak_ubuntu_16.04 +test -d ubuntu_16.04 || mkdir ubuntu_16.04 +mv xmr-stak/bin/* ubuntu_16.04 git -C xmr-stak clean -fd ######################## # Ubuntu 14.04 ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak ubuntu:14.04 /bin/bash -c " -set -ex ; +docker run --rm -it -v $PWD:/mnt ubuntu:14.04 /bin/bash -c " +set -x ; apt update -qq ; apt install -y -qq curl libmicrohttpd-dev libssl-dev libhwloc-dev software-properties-common ; add-apt-repository -y ppa:ubuntu-toolchain-r/test ; apt update -qq ; -apt install -y -qq gcc-7 g++-7 make ; -update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 1 --slave /usr/bin/g++ g++ /usr/bin/g++-7 ; +apt install -y -qq gcc-6 g++-6 make ; +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 1 --slave /usr/bin/g++ g++ /usr/bin/g++-6 ; curl -L https://cmake.org/files/LatestRelease/cmake-3.10.0.tar.gz | tar -xzf - -C /tmp/ ; ( cd /tmp/cmake-*/ && ./configure && make && sudo make install && cd - ) > /dev/null update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force ; -cd /xmr-stak ; -cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; +cd /mnt/xmr-stak ; +/mnt/cuda_*_linux-run --silent --toolkit ; +cmake -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF . ; make ; " -mv xmr-stak/bin/xmr-stak xmr-stak_ubuntu_14.04 +test -d ubuntu_14.04 || mkdir ubuntu_14.04 +mv xmr-stak/bin/* ubuntu_14.04 git -C xmr-stak clean -fd ######################## # CentOS 7 ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak centos:7 /bin/bash -c " -set -ex ; +# CUDA is not going to work on CentOS/RHEL beacuse it's only support gcc-4 in these distributions: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html +docker run --rm -it -v $PWD:/mnt centos:7 /bin/bash -c " +set -x ; yum install -y -q centos-release-scl epel-release ; -yum install -y -q cmake3 devtoolset-4-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make ; -scl enable devtoolset-4 - << EOF -cd /xmr-stak ; +yum install -y -q cmake3 devtoolset-7-gcc* hwloc-devel libmicrohttpd-devel make openssl-devel perl ; +scl enable devtoolset-7 - << EOF +cd /mnt/xmr-stak ; cmake3 -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; make ; EOF " -mv xmr-stak/bin/xmr-stak xmr-stak_centos_7 +test -d centos_7 || mkdir centos_7 +mv xmr-stak/bin/* centos_7 git -C xmr-stak clean -fd ######################## # CentOS 6.x ######################## -docker run --rm -it -v $PWD/xmr-stak:/xmr-stak centos:6 /bin/bash -c " -set -ex ; +# CUDA is not going to work on CentOS/RHEL beacuse it's only support gcc-4 in these distributions: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html +docker run --rm -it -v $PWD:/mnt centos:6 /bin/bash -c " +set -x ; yum install -y -q centos-release-scl epel-release ; -yum install -y -q cmake3 devtoolset-4-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make ; -scl enable devtoolset-4 - << EOF -cd /xmr-stak ; +yum install -y -q cmake3 devtoolset-7-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make ; +scl enable devtoolset-7 - << EOF +cd /mnt/xmr-stak ; cmake3 -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF . ; make ; EOF " -mv xmr-stak/bin/xmr-stak xmr-stak_centos_6 +test -d centos_6 || mkdir centos_6 +mv xmr-stak/bin/* centos_6 git -C xmr-stak clean -fd rm -rf xmr-stak |