Skip to content

Instantly share code, notes, and snippets.

@lukecampbell
Created February 2, 2017 15:47
Show Gist options
  • Save lukecampbell/f41966583668c800dd4cafd1ffd68600 to your computer and use it in GitHub Desktop.
Save lukecampbell/f41966583668c800dd4cafd1ffd68600 to your computer and use it in GitHub Desktop.
Docker container demonstrating lxml bug

Conda build for lxml fails

Build instructions

  1. Get Docker

  2. Create a folder called build

  3. Copy Dockerfile to the folder build

  4. build:

    docker build -t test_xml .
    
  5. test:

    docker run -it --rm test_xml
    
FROM phusion/baseimage:0.9.18
MAINTAINER Luke Campbell <[email protected]>
# General dependencies:
RUN apt-get update && \
apt-get install -y wget git build-essential libxml2 libicu52
# Install nodejs/npm and friends:
RUN (curl -sL https://deb.nodesource.com/setup_6.x | bash) && \
apt-get update && \
apt-get install -y nodejs && \
npm install -g grunt-cli && \
rm -rf /var/lib/apt/lists/*
# Install conda/python
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.0.5-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
export PATH="/opt/conda/bin:${PATH}" && \
conda config --set always_yes yes --set changeps1 no && \
conda config --set show_channel_urls True && \
conda config --add create_default_packages pip && \
echo 'conda 4.0.*' >> /opt/conda/conda-meta/pinned && \
conda update conda && \
conda config --add channels conda-forge && \
conda clean --all --yes
ENV PATH=/opt/conda/bin:$PATH
RUN conda install lxml
RUN echo "from lxml import etree as ET" > /test_xml.py
CMD ["/opt/conda/bin/python", "/test_xml.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment