0

I am running into issues building my Docker container. Not entirely sure what I need to do here.

Dockerfile

FROM ubuntu:14.04

RUN apt-get update \
&& apt-get install -y tar git curl nano wget dialog net-tools build-essential \
&& apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev
ADD . /bot
WORKDIR /bot
RUN sudo pip3 install -r requirements.txt

CMD ["python3", "app.py"]

Requirements.txt

Flask==0.10.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.3
itsdangerous==0.24
lxml==3.5.0
requests==2.9.1
uWSGI==2.0.12
wikiquote==0.1.2

errors

http://hastebin.com/ipatorezos.coffee

[Edit] This appears to fix it. Added other input. Thanks!

FROM ubuntu:14.04

RUN apt-get update \
    && apt-get install -y tar git curl nano wget dialog net-tools build-essential \
    && apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
    && apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev
ADD . /bot
WORKDIR /bot
RUN pip3 install -r requirements.txt

CMD ["python3", "app.py"]
Adam
  • 3,992
  • 2
  • 19
  • 39

1 Answers1

1

The error seems to be around:

Using build configuration of libxslt
        building 'lxml.etree' extension
        x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Isrc/lxml/includes -I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
        In file included from src/lxml/lxml.etree.c:323:0:
        src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
         #include "libxml/xmlversion.h"

From "How to install lxml on Ubuntu", add to your Dockerfile:

&& apt-get install libxml2-dev libxslt-dev python-dev zlib1g-dev

Also, make sure your VM has enough memory (if the apt-get install fails).

The OP confirms the full apt-get command would be:

RUN apt-get update \
    && apt-get install -y tar git curl nano wget dialog net-tools build-essential \
    && apt-get install --no-install-recommends -y -q python3 python3-pip python3-dev \
    && apt-get install -y libxml2-dev libxslt-dev python-dev zlib1g-dev
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250