如何在 docker 映像 python3.8-slim 没有安装候选时添加 libpcre3-dev
How to add a libpcre3-dev to docker image python3.8-slim when there is no installation candidate
我在 uwsgi 上使用 Python3.8-slim 图像作为 运行 的 djangoapp,但 uwsgi 需要 libpcre3-dev
来构建 pcre 支持。
当我加上RUN apt-get install -y libpcre3 libpcre3-dev
FROM python:3.8-slim
...
# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1
...
RUN apt-get install -y libpcre3 libpcre3-dev
RUN pip install uwsgi # hopefully uwsgi should built with PCRE support now?
到我的 dockerfile,我得到
E: Package 'libpcre3-dev' has no installation candidate
如何安装?
编辑:这是完整的 Dockerfile:
https://github.com/timberline-secondary/hackerspace/blob/f36cafd4c7d97eb989c37bbc9dfdc9c8ddf126c5/Dockerfile
将您的行替换为
RUN apt-get update && apt-get install -y libpcre3 libpcre3-dev
您在没有 apt-get 更新的情况下收到此消息。试试下面的代码。
RUN apt-get update &&\
apt-get install -y libpcre3 libpcre3-dev
我在 uwsgi 上使用 Python3.8-slim 图像作为 运行 的 djangoapp,但 uwsgi 需要 libpcre3-dev
来构建 pcre 支持。
当我加上RUN apt-get install -y libpcre3 libpcre3-dev
FROM python:3.8-slim
...
# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1
...
RUN apt-get install -y libpcre3 libpcre3-dev
RUN pip install uwsgi # hopefully uwsgi should built with PCRE support now?
到我的 dockerfile,我得到
E: Package 'libpcre3-dev' has no installation candidate
如何安装?
编辑:这是完整的 Dockerfile: https://github.com/timberline-secondary/hackerspace/blob/f36cafd4c7d97eb989c37bbc9dfdc9c8ddf126c5/Dockerfile
将您的行替换为
RUN apt-get update && apt-get install -y libpcre3 libpcre3-dev
您在没有 apt-get 更新的情况下收到此消息。试试下面的代码。
RUN apt-get update &&\
apt-get install -y libpcre3 libpcre3-dev