gocv
gocv copied to clipboard
Cannot build docker image on mac M1
Description
I clone repository and try running make docker
but got this error.
docker build --build-arg OPENCV_VERSION=4.10.0 --build-arg GOVERSION=1.22.3 .
[+] Building 106.8s (9/9) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 252B 0.0s
=> [internal] load metadata for ghcr.io/hybridgroup/opencv:4.10.0 2.7s
=> [auth] hybridgroup/opencv:pull token for ghcr.io 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 15.06kB 0.0s
=> [1/4] FROM ghcr.io/hybridgroup/opencv:4.10.0@sha256:22cef7f1027ea868a820e7c71f642150454777c7bd0d401b09acabe750411a2f 0.0s
=> CACHED [2/4] COPY . /go/src/gocv.io/x/gocv/ 0.0s
=> CACHED [3/4] WORKDIR /go/src/gocv.io/x/gocv 0.0s
=> ERROR [4/4] RUN go build -tags example -o /build/gocv_version ./cmd/version/ 103.6s
------
> [4/4] RUN go build -tags example -o /build/gocv_version ./cmd/version/:
103.2 # gocv.io/x/gocv/cmd/version
103.2 /usr/local/go/pkg/tool/linux_arm64/link: running g++ failed: exit status 1
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::spawn(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::deallocate(tbb::detail::d1::small_object_pool&, void*, unsigned long, tbb::detail::d1::execution_data const&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::initialize(tbb::detail::d1::task_arena_base&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long, tbb::detail::d1::execution_data const&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::execute(tbb::detail::d1::task_arena_base&, tbb::detail::d1::delegate_base&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::terminate(tbb::detail::d1::task_arena_base&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::initialize(tbb::detail::d1::task_group_context&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::is_group_execution_cancelled(tbb::detail::d1::task_group_context&)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::max_concurrency(tbb::detail::d1::task_arena_base const*)'
103.2 /usr/bin/ld: /usr/local/lib/libopencv_core.so: undefined reference to `tbb::detail::r1::notify_waiters(unsigned long)'
103.2 collect2: error: ld returned 1 exit status
103.2
------
Dockerfile:8
--------------------
6 |
7 | WORKDIR /go/src/gocv.io/x/gocv
8 | >>> RUN go build -tags example -o /build/gocv_version ./cmd/version/
9 |
10 | CMD ["/build/gocv_version"]
--------------------
ERROR: failed to solve: process "/bin/sh -c go build -tags example -o /build/gocv_version ./cmd/version/" did not complete successfully: exit code: 1
View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/rpwdonoen92b698bxi1ko25rr
make: *** [docker] Error 1
Steps to Reproduce
- Run
make docker
Your Environment
- Operating System and version:
macOS Sonoma 14.5
- OpenCV version used:
4.10.0
- GOVERSION:
1.22.3
- Docker image:
ghcr.io/hybridgroup/opencv:4.10.0