Search code examples
python-3.xdockeruwsgipcre

How to add a libpcre3-dev to docker image python3.8-slim when there is no installation candidate


I'm using the Python3.8-slim image for a djangoapp that run on uwsgi, but uwsgi needs libpcre3-dev to build with pcre support.

When I add 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?

to my dockerfile, I get

E: Package 'libpcre3-dev' has no installation candidate

How can I install it?

Edit: Here's the full Dockerfile: https://github.com/timberline-secondary/hackerspace/blob/f36cafd4c7d97eb989c37bbc9dfdc9c8ddf126c5/Dockerfile


Solution

  • You get this message without apt-get update. Try below code.

    RUN apt-get update &&\
     apt-get install -y libpcre3 libpcre3-dev