mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-09 23:37:06 +00:00
Add Docker builder image with CUDA 11.4, GCC 10, CMake 4, and Go 1.25.3
- Build CUDA 11.4 toolkit from NVIDIA repository (for K80 compute 3.7 support) - Build GCC 10 from source (required for CUDA 11.4 compatibility) - Build CMake 4.0.0 from source (latest version) - Install Go 1.25.3 from official tarball - Configure library paths via /etc/ld.so.conf.d/gcc-10.conf and ldconfig - Add /etc/profile.d scripts for interactive shell PATH setup - Use ENV statements for Docker build-time and runtime PATH configuration - Switch from nvidia/cuda base image to rockylinux:8 for full control
This commit is contained in:
@@ -1,55 +1,58 @@
|
||||
FROM nvidia/cuda:11.4.3-devel-rockylinux8
|
||||
FROM rockylinux/rockylinux:8
|
||||
|
||||
# Update OS and install cuda toolkit 11.4 and nvdia driver 470
|
||||
#RUN dnf -y update\
|
||||
# && dnf -y install epel-release\
|
||||
# && dnf -y config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo\
|
||||
# && dnf -y module install nvidia-driver:470-dkms\
|
||||
# && dnf -y install cuda-11-4
|
||||
|
||||
RUN dnf -y install epel-release\
|
||||
&& dnf -y config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo\
|
||||
&& dnf -y install cuda-11-4
|
||||
|
||||
# Post install, setup path
|
||||
#COPY cuda-11.4.sh /etc/profile.d/cuda-11.4.sh
|
||||
COPY cuda-11.4.sh /etc/profile.d/cuda-11.4.sh
|
||||
ENV PATH="$PATH:/usr/local/cuda-11.4/bin"
|
||||
#ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib64:/usr/local/lib64"
|
||||
|
||||
# Install gcc 10
|
||||
#RUN dnf -y install wget unzip lbzip2\
|
||||
# && dnf -y groupinstall "Development Tools"\
|
||||
# && cd /usr/local/src\
|
||||
# && wget https://github.com/gcc-mirror/gcc/archive/refs/heads/releases/gcc-10.zip\
|
||||
# && unzip gcc-10.zip\
|
||||
# && cd gcc-releases-gcc-10\
|
||||
# && contrib/download_prerequisites\
|
||||
# && mkdir /usr/local/gcc-10\
|
||||
# && cd /usr/local/gcc-10\
|
||||
# && /usr/local/src/gcc-releases-gcc-10/configure --disable-multilib\
|
||||
# && make -j ${nproc}\
|
||||
# && make install
|
||||
RUN dnf install -y gcc-toolset-10-gcc gcc-toolset-10-gcc-c++ gcc-toolset-10-runtime
|
||||
RUN dnf -y install wget unzip bzip2\
|
||||
&& dnf -y groupinstall "Development Tools"\
|
||||
&& cd /usr/local/src\
|
||||
&& wget https://github.com/gcc-mirror/gcc/archive/refs/heads/releases/gcc-10.zip\
|
||||
&& unzip gcc-10.zip\
|
||||
&& cd gcc-releases-gcc-10\
|
||||
&& contrib/download_prerequisites\
|
||||
&& mkdir /usr/local/gcc-10\
|
||||
&& cd /usr/local/gcc-10\
|
||||
&& /usr/local/src/gcc-releases-gcc-10/configure --disable-multilib\
|
||||
&& make -j $(nproc)\
|
||||
&& make install
|
||||
|
||||
# Post install, setup path
|
||||
#COPY gcc-10.sh /etc/profile.d/gcc-10.sh
|
||||
#COPY gcc-10.sh /etc/ld.so.conf.d/gcc-10.conf
|
||||
#RUN scl enable gcc-toolset-10 bash
|
||||
#ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib64:/usr/local/lib64"
|
||||
COPY gcc-10.conf /etc/ld.so.conf.d/gcc-10.conf
|
||||
RUN ldconfig\
|
||||
&& rm -f /usr/bin/cc\
|
||||
&& ln -s /usr/local/bin/gcc /usr/bin/cc
|
||||
|
||||
# Install cmake
|
||||
#ENV LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/cuda-11.4/lib64"
|
||||
#ENV PATH="/usr/local/cuda-11.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
#RUN dnf -y install openssl-devel\
|
||||
# && cd /usr/local/src\
|
||||
# && wget https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0.tar.gz\
|
||||
# && tar xvf cmake-4.0.0.tar.gz\
|
||||
# && mkdir /usr/local/cmake-4\
|
||||
# && cd /usr/local/cmake-4\
|
||||
# && /usr/local/src/cmake-4.0.0/configure\
|
||||
# && make -j ${nproc}\
|
||||
# && make install
|
||||
RUN dnf -y install cmake
|
||||
#ENV LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
|
||||
#ENV PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
RUN dnf -y install openssl-devel\
|
||||
&& cd /usr/local/src\
|
||||
&& wget https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0.tar.gz\
|
||||
&& tar xvf cmake-4.0.0.tar.gz\
|
||||
&& mkdir /usr/local/cmake-4\
|
||||
&& cd /usr/local/cmake-4\
|
||||
&& /usr/local/src/cmake-4.0.0/configure\
|
||||
&& make -j $(nproc)\
|
||||
&& make install
|
||||
|
||||
# Install go
|
||||
#RUN cd /usr/local\
|
||||
# && wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz\
|
||||
# && tar xvf go1.24.2.linux-amd64.tar.gz
|
||||
RUN dnf -y install golang
|
||||
RUN cd /usr/local\
|
||||
&& wget https://go.dev/dl/go1.25.3.linux-amd64.tar.gz\
|
||||
&& tar xvf go1.25.3.linux-amd64.tar.gz
|
||||
|
||||
# Post install, setup path
|
||||
#COPY go-1.24.2.sh /etc/profile.d/go-1.24.2.sh
|
||||
#ENV PATH="$PATH:/usr/local/go/bin"
|
||||
COPY go.sh /etc/profile.d/go.sh
|
||||
ENV PATH="$PATH:/usr/local/go/bin"
|
||||
|
||||
1
docker/builder/cuda-11.4.sh
Normal file
1
docker/builder/cuda-11.4.sh
Normal file
@@ -0,0 +1 @@
|
||||
export PATH="${PATH}:/usr/local/cuda-11.4/bin"
|
||||
1
docker/builder/gcc-10.conf
Normal file
1
docker/builder/gcc-10.conf
Normal file
@@ -0,0 +1 @@
|
||||
/usr/local/lib64
|
||||
1
docker/builder/go.sh
Normal file
1
docker/builder/go.sh
Normal file
@@ -0,0 +1 @@
|
||||
export PATH="${PATH}:/usr/local/go/bin"
|
||||
Reference in New Issue
Block a user