[英]Docker ERROR: unsatisfiable constraints when using apk
我將其用作我的 Dockerfile。 在構建它時,代碼存在於第 2 步。
FROM python:3.7-alpine
RUN apk update && apk add --no-cache gcc libffi-dev g++ python-dev build-base linux-headers postgresql-dev postgresql-contrib pcre-dev bash alpine-sdk jpeg-dev zlib-dev \ && pip install wheel
COPY ./requirements.txt .
RUN pip install -r requirements.txt
這就是我在終端上得到的
Building web
Step 1/18 : FROM python:3.7-alpine
---> 7fbc871584eb
Step 2/18 : RUN apk update && apk add --no-cache gcc libressl libffi-dev g++ python-dev build-base linux-headers postgresql-dev postgresql-contrib pcre-dev bash alpine-sdk jpeg-dev zlib-dev \ && pip install wheel
---> Running in 102a327c46d9
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
v3.11.5-56-gd94bd50429 [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.5-54-g70c5111c08 [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
OK: 11274 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
(missing):
required by: world[]
ERROR: Service 'web' failed to build: The command '/bin/sh -c apk update && apk add --no-cache gcc libressl libffi-dev g++ python-dev build-base linux-headers postgresql-dev postgresql-contrib pcre-dev bash alpine-sdk jpeg-dev zlib-dev \ && pip install wheel' returned a non-zero code: 1
我的 Docker 版本 19.03.3
你只是在RUN
命令中有一個不必要的\
,就在pip install wheel
之前。 刪除它,它會工作。
RUN apk update && apk add --no-cache gcc libffi-dev g++ python-dev build-base linux-headers postgresql-dev postgresql-contrib pcre-dev bash alpine-sdk jpeg-dev zlib-dev && pip install wheel
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.