xmba15 / onnx_runtime_cpp

small c++ library to quickly deploy models using onnxruntime
MIT License
327 stars 49 forks source link

docker build -f ./dockerfiles/ubuntu2004.dockerfile -t onnx_runtime . FAIL #49

Closed foxnight2 closed 1 year ago

foxnight2 commented 1 year ago
docker build -f ./dockerfiles/ubuntu2004.dockerfile -t onnx_runtime .
| >>> RUN apt-get update && \
   9 | >>>     apt-get install -y --no-install-recommends \
  10 | >>>         sudo \
  11 | >>>         gnupg2 \
  12 | >>>         lsb-release \
  13 | >>>         build-essential \
  14 | >>>         software-properties-common \
  15 | >>>         cmake \
  16 | >>>         git \
  17 | >>>         tmux && \
  18 | >>>     bash install_latest_cmake.bash && \
  19 | >>>     bash install_onnx_runtime.bash && \
  20 | >>>     bash install_apps_dependencies.bash && \
  21 | >>>     rm -rf /build && \
  22 | >>>     apt-get clean && \
  23 | >>>     rm -rf /var/lib/apt/lists/*
  24 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update &&     apt-get install -y --no-install-recommends         sudo         gnupg2         lsb-release         build-essential         software-properties-common         cmake         git         tmux &&     bash install_latest_cmake.bash &&     bash install_onnx_runtime.bash &&     bash install_apps_dependencies.bash &&     rm -rf /build &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100
xmba15 commented 1 year ago

Can you check the instruction here?

https://github.com/xmba15/onnx_runtime_cpp/issues/34

Can you also share docker version if you still can't build after reading the above instruction?

foxnight2 commented 1 year ago

It doesn't help for me. I fail with the step docker build -f ./dockerfiles/ubuntu2004.dockerfile -t onnx_runtime . and the step is the first on #34

docker version

Client:
 Cloud integration: v1.0.35-desktop+001
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:36:24 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.22.1 (118664)
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:45 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
xmba15 commented 1 year ago

It's difficult to suggest in this case. Because the above error log does not specify where the build failed.

Two guesses you can try here:

  1. Change the following line in the dockerfile

    FROM ubuntu:20.04

    to

FROM --platform=linux/amd64 ubuntu:20.04

or

FROM --platform=linux/x86_64 ubuntu:20.04
  1. Comment out these lines gradually and see where the docker build fails, then you might know what to do next.
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        sudo \
        gnupg2 \
        lsb-release \
        build-essential \
        software-properties-common \
        cmake \
        git \
        tmux && \
    bash install_latest_cmake.bash && \
    bash install_onnx_runtime.bash && \
    bash install_apps_dependencies.bash && \
    rm -rf /build && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*