From c821153450625e1813c4b15130bf477ba2cf22d1 Mon Sep 17 00:00:00 2001 From: Antony Bailey Date: Sat, 9 Mar 2024 13:07:37 +0000 Subject: [PATCH] Init docker build (#76) * Init docker build * Set workdir before switching branches * nvidia drivers * ldconfig * Actions can't run as no GPU * Docker prune * Disk space docker pull parttimelegend/ccminer --- .github/workflows/docker-image.yml | 19 ++++++++++++++ Dockerfile | 42 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000000..d16b1ec3a0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,19 @@ +name: Docker Image CI + +on: + push: + branches: [ linux ] + pull_request: + branches: [ linux ] + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag ccminer:latest --no-cache + - name: Docker image list + run: docker images diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..ad1c364a58 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:rolling +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=Europe/London +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get dist-upgrade -y && \ + apt-get install libcurl4-openssl-dev \ + libssl-dev \ + libjansson-dev \ + automake \ + autotools-dev \ + build-essential \ + git \ + freeglut3 \ + freeglut3-dev \ + libxi-dev \ + libxmu-dev \ + wget \ + nvidia-driver-455 \ + -y +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin +RUN mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 +RUN wget https://developer.download.nvidia.com/compute/cuda/11.2.1/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.1-460.32.03-1_amd64.deb +RUN dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.1-460.32.03-1_amd64.deb +RUN apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub +RUN apt-get update +RUN apt-get -y install cuda +RUN git clone https://github.com/tpruvot/ccminer +WORKDIR ccminer +RUN git checkout linux +RUN ./build.sh +RUN ldconfig /usr/local/cuda/lib64 +#RUN ./ccminer --version +RUN apt-get remove libcurl4-openssl-dev \ + libssl-dev \ + libjansson-dev \ + freeglut3 \ + freeglut3-dev \ + libxi-dev \ + libxmu-dev \ + -y +#ENTRYPOINT [ "./ccminer" ]