FROM erwinchang/ubuntu-12.04-32bit-build

# Setup APT sources

RUN sed s,ubuntu\.stu\.edu\.tw,archive.ubuntu.com, /etc/apt/sources.list > /tmp/sources.list \
  && mv /tmp/sources.list /etc/apt/sources.list



# Install dependencies
RUN apt-get update \
  && apt-get install -y \
    build-essential \
    curl \
    fuse \
    git \
    graphicsmagick \
    icnsutils \
    jq \
    libasound2 \
    libgconf-2-4 \
    libgtk2.0-0 \
    libx11-xcb1 \
    libnss3 \
    libxss1 \
    libxtst6 \
    libyaml-dev \
    python \
    python-pip \
    python-dev \
    python-software-properties \
    unzip \
    xorriso \
    xvfb \
    xz-utils \
    zip \
    rpm

# Install a C++11 compiler
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
  && apt-get update && apt-get install -y gcc-4.8 g++-4.8 \
  && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

# NodeJS
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
  && apt-get install -y nodejs

# See https://github.com/mapbox/node-pre-gyp/issues/165
RUN npm config set unsafe-perm=true

RUN npm config set spin=false

# Python
COPY requirements.txt requirements.txt
RUN pip install --quiet -r requirements.txt
