Failure when building docker from source code Dockerfile
lewismacnow opened this issue · comments
What is the issue?
When building using the Dockerfile in the source code, it fails at the point of retrieving cmake v 3.22.1
It seems to fail at:
./scripts/rh_linux_deps.sh
if [ -n "${CMAKE_VERSION}" ]; then
curl -s -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$(uname -m).tar.gz | tar -zx -C /usr --strip-components 1
fi
Full logs
mack@compute:/ssd2tb/project/ollama$ docker build .
[+] Building 252.0s (16/44) docker:default
=> [rocm-build-amd64 1/7] FROM docker.io/rocm/dev-centos-7:6.0.2-complete@sha256:f5f81602da6922d5cb2b8c401ff17c2f9831218cdaee7aae89708fb47887a940 251.6s
=> => sha256:0f21a01f46f783d813734c4dd3f936de3148833c29bc1f0b746ad68b6920413a 12.73MB / 12.73MB 20.6s
=> => extracting sha256:efe73c33219bbfd33f6b161dcc408933afb29d0a6c9eebeab5133b0951f10515 4.8s
=> => sha256:94bdd17ca07b0da7058aa440236a637ba8195769217aecfc905bc9cb98ea102e 108.33MB / 108.33MB 30.8s
=> => extracting sha256:78f868d94ab5bbbdd71e169e9a62fc111a6b3b09ecfa0bdf8b400c46dffd5c60 3.6s
=> => sha256:83ef8a99220c3de4014886999044dbcc067087cc1d05a5a4122937e881b29f0d 172.23MB / 172.23MB 46.7s
=> => sha256:43d144d2a282ff7b5f2458877e18b7eaca9ab429a0747977967125a40bf0f029 73.95MB / 73.95MB 50.2s
=> => extracting sha256:97e8e2960c7d084dd18dacbf57329fa3a7fff614b2fffa28502da08c4eba8c7c 13.5s
=> => sha256:cdda4c5e1870aa78442033b555f149d1fb88fe5479b299560a60bae8f0a13301 13.09MB / 13.09MB 47.5s
=> => sha256:78ac3b9ce97cc50875a62632a42c9dc09394c4f045809d9a82bae4510a378a94 234B / 234B 46.9s
=> => sha256:f6a84c9211b74432341b2071b86dee27e9f978ad8c73bd248bf4841e94ab0861 240B / 240B 47.1s
=> => sha256:7a8dbfe442e0f5995fd0f17b31ba7ce6144aa90278d40fbaa66daa50c2dba2ab 3.51GB / 4.21GB 251.6s
=> => extracting sha256:4c06079f3eee40f450795fa5883a422dbe80f1d5ce6949eab86683afeaa174d2 3.7s
=> => extracting sha256:0f21a01f46f783d813734c4dd3f936de3148833c29bc1f0b746ad68b6920413a 0.7s
=> => extracting sha256:94bdd17ca07b0da7058aa440236a637ba8195769217aecfc905bc9cb98ea102e 4.7s
=> => extracting sha256:83ef8a99220c3de4014886999044dbcc067087cc1d05a5a4122937e881b29f0d 8.1s
=> => extracting sha256:43d144d2a282ff7b5f2458877e18b7eaca9ab429a0747977967125a40bf0f029 4.2s
=> => extracting sha256:cdda4c5e1870aa78442033b555f149d1fb88fe5479b299560a60bae8f0a13301 0.7s
=> => extracting sha256:78ac3b9ce97cc50875a62632a42c9dc09394c4f045809d9a82bae4510a378a94 0.0s
=> => extracting sha256:f6a84c9211b74432341b2071b86dee27e9f978ad8c73bd248bf4841e94ab0861 0.0s
=> [cuda-build-amd64 1/6] FROM docker.io/nvidia/cuda:11.3.1-devel-centos7@sha256:47c328a6ecf7760a65d6eee834be8040054ada756d14fe848fb5842aa0fb96d6 0.0s
=> CACHED [runtime-amd64 2/3] RUN apt-get update && apt-get install -y ca-certificates 0.0s
=> [cpu-builder-amd64 1/5] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4 0.0s
=> CACHED [cuda-build-amd64 2/6] COPY ./scripts/rh_linux_deps.sh / 0.0s
=> CACHED [cpu-builder-amd64 2/5] COPY ./scripts/rh_linux_deps.sh / 0.0s
=> [llm-code 1/3] COPY .git .git 0.0s
=> [cpu-builder-amd64 3/5] RUN CMAKE_VERSION=3.22.1 GOLANG_VERSION=1.22.1 sh /rh_linux_deps.sh 251.5s
=> => # kernel-headers-3.10.0-1160.118.1.el7.x86_64
=> => # Complete!
=> => # + '[' -n 3.22.1 ']'
=> => # + tar -zx -C /usr --strip-components 1
=> => # ++ uname -m
=> => # + curl -s -L https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz
=> [cuda-build-amd64 3/6] RUN CMAKE_VERSION=3.22.1 sh /rh_linux_deps.sh 251.5s
=> => # setools-libs-3.3.8-4.el7.x86_64
=> => # Complete!
=> => # + '[' -n 3.22.1 ']'
=> => # + tar -zx -C /usr --strip-components 1
=> => # ++ uname -m
=> => # + curl -s -L https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz
=> [llm-code 2/3] COPY .gitmodules .gitmodules 0.1s
=> [llm-code 3/3] COPY llm llm 0.0s
It hangs here until the error:
215.9 Complete!
215.9 + '[' -n 3.22.1 ']'
215.9 + tar -zx -C /usr --strip-components 1
215.9 ++ uname -m
215.9 + curl -s -L https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz
409.1
409.1 gzip: stdin: unexpected end of file
409.1 tar: Child returned status 1
409.1 tar: Error is not recoverable: exiting now
------
Dockerfile:16
--------------------
14 | ARG CMAKE_VERSION
15 | COPY ./scripts/rh_linux_deps.sh /
16 | >>> RUN CMAKE_VERSION=${CMAKE_VERSION} sh /rh_linux_deps.sh
17 | ENV PATH /opt/rh/devtoolset-10/root/usr/bin:$PATH
18 | COPY --from=llm-code / /go/src/github.com/ollama/ollama/
--------------------
ERROR: failed to solve: process "/bin/sh -c CMAKE_VERSION=${CMAKE_VERSION} sh /rh_linux_deps.sh" did not complete successfully: exit code: 2
OS
Docker
GPU
Nvidia
CPU
AMD
Ollama version
0.1.37
To build it, you need to build it with the script which uses podman (RHEL) flags (--load, --push) from what I tried:
./scripts/build_docker.sh