gpt4 book ai didi

python - 错误 : unsatisfiable constraints - Docker

转载 作者:行者123 更新时间:2023-11-28 22:16:55 27 4
gpt4 key购买 nike

当我安装 Python 项目时,Docker 出现此错误。尽管在谷歌上进行了研究,但我没有找到解决方案。顺便说一下,当我在 Docker 上运行项目时,如何在浏览器上显示?

test@test-VirtualBox:~/backend$ sudo docker build  -t test .
Sending build context to Docker daemon 489kB
Step 1/11 : FROM python:3.6-alpine
---> 267db919e15e
Step 2/11 : RUN addgroup -S app && adduser -S -g app app
---> Using cache
---> ce1632a22469
Step 3/11 : WORKDIR /usr/src/app
---> Using cache
---> 01b36ea9b7c1
Step 4/11 : RUN apk --update --upgrade add --virtual deps gcc python3-dev linux-headers musl-dev alpine-sdk openssl-dev gmp-dev libffi-dev postgresql-dev && apk --update --upgrade add --no-cache libpq gmp
---> Running in d962dfc4a26a
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
openssl-dev-1.0.2o-r2:
conflicts:
libressl-dev-2.7.4-r0[pc:libcrypto=1.0.2o]
libressl-dev-2.7.4-r0[pc:libssl=1.0.2o]
libressl-dev-2.7.4-r0[pc:openssl=1.0.2o]
libressl-dev-2.7.4-r0:
conflicts:
openssl-dev-1.0.2o-r2[pc:libcrypto=2.7.4]
openssl-dev-1.0.2o-r2[pc:libssl=2.7.4]
openssl-dev-1.0.2o-r2[pc:openssl=2.7.4]
satisfies:
postgresql-dev-10.5-r0[libressl-dev]
deps-0:
masked in: cache
satisfies: world[deps]
The command '/bin/sh -c apk --update --upgrade add --virtual deps gcc python3-dev linux-headers musl-dev alpine-sdk openssl-dev gmp-dev libffi-dev postgresql-dev && apk --update --upgrade add --no-cache libpq gmp' returned a non-zero code: 4

docker 文件:

FROM python:3.6-alpine

RUN addgroup -S app && adduser -S -g app app
WORKDIR /usr/src/app

RUN apk --update --upgrade add --virtual deps \
gcc python3-dev linux-headers musl-dev \
alpine-sdk gmp-dev libffi-dev \
postgresql-dev && \
apk --update --upgrade add --no-cache libpq gmp

COPY ./requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN apk del deps

COPY . /usr/src/app
RUN chown -R app:app /usr/src/app

USER app

EXPOSE 8080

最佳答案

为什么需要安装openssl-dev包? Alpine 包是用 libressl 编译的。您不能在装有 alphine 3.6 的容器中同时安装 openssl-devlibressl-dev

关于python - 错误 : unsatisfiable constraints - Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51798338/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com