I want to deploy my Python project in Docker, I wrote lxml>=3.5.0 in Requirments.txt, because the project requires lxml. Here is my dock file:
FROM gliderlabs/alpine:3.3 RUN set -x \ && buildDeps='\ python-dev \ py-pip \ build-base \ ' \ && apk --update add python py-lxml $buildDeps \ && rm -rf /var/cache/apk/* \ && mkdir -p /app ENV INSTALL_PATH /app WORKDIR $INSTALL_PATH COPY requirements-docker.txt ./ RUN pip install -r requirements.txt COPY . . RUN apk del --purge $buildDeps ENTRYPOINT ["celery", "-A", "tasks", "worker", "-l", "info", "-B"]
I got this when deployed in docker:
********************************************************************************* Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? ********************************************************************************* error: command 'gcc' failed with exit status 1 ---------------------------------------- Rolling back uninstall of lxml
I thought this was due to 'python-dev' and 'python-lxml', then I edited the dock file like this:
WORKDIR $INSTALL_PATH COPY requirements-docker.txt ./ RUN apt-get build-dev python-lxml RUN pip install -r requirements.txt
This did not work, and I got another error:
---> Running in 73201a0dcd59 /bin/sh: apt-get: not found
How to install lxml in docker?
source share