Alpine package install protocol error - docker

I am trying to install git on alpine 3.6. It is failing with Protocol error in the first instance but works on the second instance. To be specific pcre and libcurl are not installed in first instance. Here's the log of what I am trying to do.
$ docker run -it alpine:3.6 /bin/sh
/ # apk --update add git
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/6) Installing ca-certificates (20161130-r2)
(2/6) Installing libssh2 (1.8.0-r1)
(3/6) Installing libcurl (7.56.1-r0)
ERROR: libcurl-7.56.1-r0: Protocol error
(4/6) Installing expat (2.2.0-r1)
(5/6) Installing pcre (8.41-r0)
ERROR: pcre-8.41-r0: Protocol error
(6/6) Installing git (2.13.5-r0)
Executing busybox-1.26.2-r9.trigger
Executing ca-certificates-20161130-r2.trigger
2 errors; 24 MiB in 15 packages
/ # git
Error loading shared library libpcre.so.1: No such file or directory (needed by /usr/bin/git)
Error relocating /usr/bin/git: pcre_compile: symbol not found
Error relocating /usr/bin/git: pcre_exec: symbol not found
Error relocating /usr/bin/git: pcre_maketables: symbol not found
Error relocating /usr/bin/git: pcre_study: symbol not found
Error relocating /usr/bin/git: pcre_free: symbol not found
Installing pcre/git again works though.
/ # apk add pcre
(1/2) Installing libcurl (7.56.1-r0)
(2/2) Installing pcre (8.41-r0)
OK: 25 MiB in 17 packages
/ # git
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]

I had this problem too (surprisingly, it was deterministic), and changing the mirror worked. For example, do:
$ echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/main" >/etc/apk/repositories
$ echo "https://mirror.csclub.uwaterloo.ca/alpine/v3.7/community" >>/etc/apk/repositories
to change the mirror to the UWaterloo server. You can find the full list of mirrors here.

Related

No matching package found (Docker + Rust)

I'm attempting to compile a Rust project in Docker and it's being frustrating. As far as I can tell it should be incredibly straightforward, but for some reason Docker can't find the Rust package.
Here's the Dockerfile:
FROM rust:1.6.1
COPY . .
RUN cargo build --release
CMD ["./run.sh"]
Here's the Cargo.toml:
[package]
name = "project1_1"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
utility = { path = "./src/utility" }
iced = "0.6.0"
iced_native = "0.4"
iced_style = "0.5"
iced_core = "0.5"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1", features = ["full"] }
webassembly = "0.8"
wry = "0.23.4"
And here's the output:
peterweyand#Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:04:06 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon 1.351GB
Step 1/4 : FROM rust:1.6.1
manifest for rust:1.6.1 not found: manifest unknown: manifest unknown
Updating git repository `https://github.com/iced-rs/iced`
Updating crates.io index
error: no matching package found
searched package name: `iced`
perhaps you meant: cached
location searched: https://github.com/iced-rs/iced
required by package `project1_1 v0.1.0 (/)`
If instead of FROM rust:1.6.1 I use FROM rust:latest then Docker hangs like this:
peterweyand#Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:08:18 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon 1.351GB
Step 1/4 : FROM rust:latest
---> 7767cd0ef4e0
Step 2/4 : COPY . .
---> 356cfb7caed9
Step 3/4 : RUN cargo build --release
---> Running in 87dbc6c86df9
Updating crates.io index
Does anyone have any ideas of what is going wrong?
EDIT: I usually suck at Docker because there are several ways of doing the same thing.
I tried this
FROM rust:1.66-alpine
WORKDIR /
COPY . .
RUN cargo install --path .
RUN apk add alpine-sdk # This one is necessary for linking cc.
COPY ./src/backend/Cargo.toml ./src/backend/Cargo.lock ./
RUN cargo build --release
CMD ["./run.sh"]
and it gave this output -
Compiling libloading v0.7.4
Compiling lock_api v0.4.9
Compiling parking_lot_core v0.9.5
Compiling toml v0.5.10
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling parking_lot v0.12.1
Compiling anyhow v1.0.66
Compiling system-deps v6.0.3
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-Wl,--version-script=/tmp/rustc2quFlR/list" "/tmp/rustc2quFlR/symbols.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.0.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.1.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.10.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.11.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.12.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.13.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.14.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.15.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.2.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.3.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.4.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.5.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.6.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.7.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.8.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.9.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2venke7z0qwetnto.rcgu.rmeta" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2bt08o7nuxqqfzig.rcgu.o" "-Wl,--as-needed" "-L" "/target/release/deps" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/target/release/deps/libquote-a78ece94a3329b46.rlib" "/target/release/deps/libproc_macro2-3f4d87b0b9f5c5f5.rlib" "/target/release/deps/libunicode_ident-5c658c6e9005d30d.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libproc_macro-16667debc3013ce2.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd-19bcd24d54b4a32c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libpanic_unwind-3814851f75d61802.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libobject-5007cbad366e7f54.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libmemchr-c7fe0e6a7e22626a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libaddr2line-cdbb9a3725d71a8c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libgimli-ad66f8ef705486ae.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_demangle-775cf8425902e89f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd_detect-d09dc442a73afb02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-508c53ad79acc8ea.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libhashbrown-ac7c150ef5940f2b.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libminiz_oxide-d2c5dbbafb505b02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libadler-fa394ecd0326b64a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_alloc-d36cf05357e3b9d8.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libunwind-32953872cd386e07.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-e844973f6e14767e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liblibc-2f732132bffc407e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liballoc-e0c40e7f51c7608f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_core-3dc8593378fc4be9.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcore-d31b035ed558dec3.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-2b952fa9bf703518.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-o" "/target/release/deps/libproc_macro_error_attr-4660f50c1ee088e6.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-nodefaultlibs"
= note: /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
error: could not compile `proc-macro-error-attr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `project1_1 v0.1.0 (/)`, intermediate artifacts can be found at `/target`
The command '/bin/sh -c cargo install --path .' returned a non-zero code: 101
Unable to find image 'my-rust-app:latest' locally
2022/12/15 17:31:02 must use ASL logging (which requires CGO) if running as root
docker: Error response from daemon: pull access denied for my-rust-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
And I also tried this -
FROM ubuntu:latest
WORKDIR /
COPY . .
RUN apt-get update
RUN apt-get install protobuf-compiler openssl pkg-config libssl-dev rustc cmake cargo -y
RUN rustc -V
CMD ["./run.sh"]
But still ran into problems compiling dependencies that relied on C.
So, my question at this point is "What is the easiest way of getting a rust program to run with a standard list of dependencies?" The hello world examples don't cut it for any Rust program that has a large crate stack.
Thanks.

Im having problems while running alphacode on ubuntu

I am using Docker Ubuntu.
I have installed the full dataset(dm-code_contests) to /tmp folder and cloned the git repository on /home folder(the repository is code_contests). When I try to run bazel run -c opt \ :print_names_and_sources /tmp/dm-code_contests/code_contests_valid.riegeli(in /home/code_contests folder), it shows error:
Starting local Bazel server and connecting to it...
INFO: Repository local_config_python instantiated at:
/home/code_contests/WORKSPACE:12:10: in <toplevel>
/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:414:21: in grpc_deps
/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/bazel/grpc_python_deps.bzl:43:21: in grpc_python_deps
Repository rule python_configure defined at:
/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl:365:35: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_python':
Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 355, column 35, in _python_autoconf_impl
_create_single_version_package(
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 304, column 45, in _create_single_version_package
python_include = _get_python_include(repository_ctx, python_bin)
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 236, column 22, in _get_python_include
result = _execute(
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 62, column 14, in _execute
_fail("\n".join([
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 35, column 9, in _fail
fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Python Configuration Error: Problem getting python include path for /usr/bin/python3.
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: /home/code_contests/WORKSPACE:12:10: fetching python_configure rule //external:local_config_python: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 355, column 35, in _python_autoconf_impl
_create_single_version_package(
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 304, column 45, in _create_single_version_package
python_include = _get_python_include(repository_ctx, python_bin)
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 236, column 22, in _get_python_include
result = _execute(
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 62, column 14, in _execute
_fail("\n".join([
File "/root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_github_grpc_grpc/third_party/py/python_configure.bzl", line 35, column 9, in _fail
fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Python Configuration Error: Problem getting python include path for /usr/bin/python3.
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: /root/.cache/bazel/_bazel_root/24a36d3f089e715b642fd688d4461183/external/com_google_riegeli/python/riegeli/records/BUILD:8:13: #com_google_riegeli//python/riegeli/records:record_writer_cc depends on #local_config_python//:python_headers in repository #local_config_python which failed to fetch. no such package '#local_config_python//': Python Configuration Error: Problem getting python include path for /usr/bin/python3.
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
Is the Python binary path set up right? (See ./configure or /usr/bin/python3.) Is distutils installed? Are Python headers installed? Try installing python-dev or python3-dev on Debian-based systems. Try python-devel or python3-devel on Redhat-based systems.
ERROR: Analysis of target '//:print_names_and_sources' failed; build aborted:
INFO: Elapsed time: 3.701s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (49 packages loaded, 348 targets configured)
FAILED: Build did NOT complete successfully (49 packages loaded, 348 targets configured)
Fetching #com_google_absl; Cloning tags/20211102.0 of https://github.com/abseil/abseil-cpp.git
root#c89a94de94ce://home/code_contests# bazel run -c opt \ :print_names_and_sources /tmp/dm-code_contests/code_contests
_valid.riegeli
ERROR: Skipping ' :print_names_and_sources': no such package ' ': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
- /home/code_contests/
WARNING: Target pattern parsing failed.
ERROR: no such package ' ': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
- /home/code_contests/
INFO: Elapsed time: 0.174s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
Im new to Ubuntu(as well as bazel). So how can I fix this error and run the project?
link to the source code: https://github.com/deepmind/code_contests
You should make sure your gcc is the latest version.
For python2 you should install it like this:
#Remove bazel and reinstall
bazel clean --expunge
rm -rf ~/.cache/bazel
To re-install follow this instruction
#Install python2 dependency
sudo apt update && sudo apt install python-dev
For a detailed explanation kindly refer to this document. Thank you!

How to solve this build error on Linux when building libsodium

I'm trying to build libsodium-sys dependency in an Azure Docker VM which is based on debian.
Have spend a couple of hours trying to fix this build error, but can't figure out what's going on.
I fixed a couple of build errors by installing missing dependencies as the Azure Docker VM seems very vanilla. Executed commands are below the error.
error: failed to run custom build command for `libsodium-sys v0.2.6 (https://github.com/cjdelisle/sodiumoxide?rev=76dc0e6e587b8c8a4bb193ebba9f8ae8f090b81b#76dc0e6e)`
Caused by:
process didn't exit successfully: `/home/packetcrypt_rs/target/release/build/libsodium-sys-169018138a0de36b/build-script-build` (exit code: 101)
checking for working alloca.h... yes
checking for alloca... yes
...
Making check in builds
--- stderr
/bin/bash: line 20: cd: builds: No such file or directory
make: *** [Makefile:516: check-recursive] Error 1
thread 'main' panicked at '
Failed to build libsodium using "make" "check" "-j4"
', /root/.cargo/git/checkouts/sodiumoxide-9b8c3ad42446e2d9/76dc0e6/libsodium-sys/build.rs:281:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
root#2d0a725cde47:/home/packetcrypt_rs#
Build.rs file it's talking about: https://github.com/sodiumoxide/sodiumoxide/blob/master/libsodium-sys/build.rs
Executed commands:
apt get-update
apt-get install pkg-config
apt install apt-utils
apt install file
apt install gcc git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install make
apt install build-essential gcc-multilib -y
rustup target add armv7-unknown-linux-gnueabihf
git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
~/.cargo/bin/cargo build --release
The cause seems related to the issue explained here: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1379#note_280986944
For reasons unbeknownst to me, these are the commands I needed to execute to fix it:
rm ~/.bashrc
rm ~/.profile

Cannot compile Open CV on Ubuntu 18.04 because of jasper.h not found

I am trying to compile Opencv on Ubuntu 18.04. I installed many dependencies packages but when I run make I get the error:
grfmt_jpeg2000.cpp:59:10: fatal error: jasper/jasper.h: No such file or directory
#include <jasper/jasper.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
I had already jasper installed and installed libjasperreports-java. However the file jasper.h cannot still be found in my system. Is there any library I can install with apt install to get that file? Or am I missing any other library?
EDIT 1
I tried also downloading the opencv_contrib to install extra moduels of openCV but first of all jaspar is not present and secondly setting the build with
cmake -D CMAKE_INSTALL_PREFIX=./ -D CMAKE_BUILD_TYPE=Debug -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../openCV
returns the error:
Make Error at cmake/OpenCVModule.cmake:352 (message):
Duplicated modules NAMES has been found
while CMakeError.log contains many errors of the type:
Build output check failed:
Regex: 'command line option .* is valid for .* but not for C\+\+'
Output line: 'cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++'

Alpine Linux How to install x86 packages on x86_64 architecture

I am trying to install 32-bit packages on official alpine docker images but whenever I do apk add libcurl for example it install 64-bit version of libcurl whereas I want to install 32-bit package.
Any thoughts how to do the same on Alpine Linux 3.7?
Actually, only one file defines which packages take from alpine repos. It is /etc/apk/arch:
# cat /etc/apk/arch
x86_64
Its value shows which packages we should take from our alpine repos:
# cat /etc/apk/repositories
http://dl-cdn.alpinelinux.org/alpine/v3.7/main
http://dl-cdn.alpinelinux.org/alpine/v3.7/community
So, we can make a trick here. We can "switch" alpine to get x86 packages from the repos:
/ # echo "x86" > /etc/apk/arch
/ # apk add --no-cache libcurl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86/APKINDEX.tar.gz
(1/12) Replacing musl (1.1.18-r2 -> 1.1.18-r2)
(2/12) Replacing busybox (1.27.2-r8 -> 1.27.2-r8)
Executing busybox-1.27.2-r8.post-upgrade
(3/12) Replacing alpine-baselayout (3.0.5-r2 -> 3.0.5-r2)
Executing alpine-baselayout-3.0.5-r2.pre-upgrade
Executing alpine-baselayout-3.0.5-r2.post-upgrade
(4/12) Replacing libressl2.6-libcrypto (2.6.3-r0 -> 2.6.3-r0)
(5/12) Replacing libressl2.6-libssl (2.6.3-r0 -> 2.6.3-r0)
(6/12) Replacing zlib (1.2.11-r1 -> 1.2.11-r1)
(7/12) Replacing apk-tools (2.8.2-r0 -> 2.8.2-r0)
(8/12) Replacing scanelf (1.2.2-r1 -> 1.2.2-r1)
(9/12) Replacing musl-utils (1.1.18-r2 -> 1.1.18-r2)
(10/12) Installing ca-certificates (20171114-r0)
(11/12) Installing libssh2 (1.8.0-r2)
(12/12) Installing libcurl (7.57.0-r0)
Executing busybox-1.27.2-r8.trigger
Executing ca-certificates-20171114-r0.trigger
OK: 5 MiB in 14 packages
Since you're using Docker, why not use the 32-bit alpine image?
$ docker run --rm -it i386/alpine
/ # apk add --no-cache libcurl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86/APKINDEX.tar.gz
...
More info: Architectures other than amd64?

Resources