当我尝试在docker中安装python3.10中的curl-cffi>=0.5.9
时,显示如下错误:
#12 50.74 gcc -shared
#12 50.74 build/temp.linux-x86_64-cpython-310/build/temp.linux-x86_64-cpython-310/curl_cff
#12 50.74 i._wrapper.o build/temp.linux-x86_64-cpython-310/curl_cffi/ffi/shim.o
#12 50.74 -L/usr/local/lib -L/usr/local/lib -lcurl-impersonate-chrome -o
#12 50.74 build/lib.linux-x86_64-cpython-310/curl_cffi/_wrapper.abi3.so
#12 50.74 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-mus
#12 50.74 l/bin/ld: cannot find -lcurl-impersonate-chrome: No such file or directory
#12 50.74 collect2: error: ld returned 1 exit status
#12 50.74 error: command '/usr/bin/gcc' failed with exit code 1
#12 50.74
#12 50.74 See /tmp/pdm-install-g3swgott.log for detailed debug log.
#12 50.74 [InstallationError]: Some package operations are not complete yet
#12 50.74 Add '-v' to see the detailed traceback
#12 ERROR: process "/bin/sh -c pdm install" did not complete successfully: exit code: 1
字符串
docker文件看起来像这样:
FROM python:3.10-alpine3.18
MAINTAINER jiangxiaoqiang ([email protected])
ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& mkdir -p /root/visa \
&& apk update \
&& apk add gcc wget curl vim musl-dev libstdc++ curl-dev g++
RUN pip install pdm
ADD . /root/visa/
WORKDIR /root/visa/
RUN pdm install
ENTRYPOINT exec /root/visa/scripts/startup-app.sh
型
我应该怎么做来解决这个问题?
1条答案
按热度按时间idv4meu81#
构建curl-impersonate-Chrome -https://github.com/lwthiker/curl-impersonate/blob/main/Dockerfile.template
或者使用它lwthiker/curl-impersonate:0.5-Chrome docker image