我正在尝试在python alpine3.9上安装libtbb库(文档明确指出,该库可用:url),但是每当我尝试构建映像时,都会收到以下错误:< / p>
ERROR: unsatisfiable constraints:
libtbb (missing):
required by: world[libtbb]
Dockerfile代码:
FROM python:3.7-alpine3.9
# Let the container know that there is no TTY
ARG DEBIAN_FRONTEND=noninteractive
# Metapackage that pulls in the most essential packages used to build new packages
# Install packages
RUN apk update \
&& apk add g++ \
libc6-compat \
make \
build-base \
openblas-dev \
unzip \
cmake \
curl \
ca-certificates \
libstdc++ \
libxml2 \
zip \
libtbb \
lua5.2 \
wget \
cmake clang clang-dev make gcc g++ libc-dev linux-headers \
boost-dev \
&& apk add --virtual build-deps gcc g++ python3-dev musl-dev
答案 0 :(得分:0)
在没有--no-cache
的同一命令中,在add
之后添加apk update
和&&
,因此apk update
将影响add
命令并更新存储库后续软件包。
--update
标志会在添加软件包之前获取当前的软件包索引
--no-cache
个APK选项。它允许用户使用实时更新和使用而不是本地缓存的索引来安装软件包:
FROM python:3.7-alpine3.9
# Let the container know that there is no TTY
ARG DEBIAN_FRONTEND=noninteractive
# Metapackage that pulls in the most essential packages used to build new packages
# Install packages
RUN apk update --no-cache add \
g++ \
libc6-compat \
make \
build-base \
openblas-dev \
unzip \
cmake \
curl \
ca-certificates \
libstdc++ \
libxml2 \
zip \
libtbb \
lua5.2 \
wget \
cmake clang clang-dev make gcc g++ libc-dev linux-headers \
boost-dev \
&& apk add --virtual build-deps gcc g++ python3-dev musl-dev
根据我的经验,这适用于当前命令,因此也许是原因,但我没有在文档中找到类似的内容,但是apk
帮助显示了这一点。
usage: apk COMMAND [-h|--help] [-p|--root DIR] [-X|--repository REPO] [-q|--quiet] [-v|--verbose] [-i|--interactive] [-V|--version] [-f|--force]
[--force-binary-stdout] [--force-broken-world] [--force-non-repository] [--force-old-apk] [--force-overwrite] [--force-refresh] [-U|--update-cache]
[--progress] [--progress-fd FD] [--no-progress] [--purge] [--allow-untrusted] [--wait TIME] [--keys-dir KEYSDIR] [--repositories-file REPOFILE]
[--no-network] [--no-cache] [--cache-dir CACHEDIR] [--arch ARCH] [--print-arch] [ARGS]...