Created
August 26, 2018 15:18
-
-
Save nestarz/4d41986b29e55bd2a7a870ee0777f3f5 to your computer and use it in GitHub Desktop.
Dockerized Ubuntu Environment with osmesa and Python bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
MAINTAINER Elias Rhouzlane <elias.rhouzlane@gmail.com> | |
RUN apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata \ | |
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \ | |
&& dpkg-reconfigure --frontend noninteractive tzdata \ | |
&& apt-get install -y python-tk | |
RUN apt-get update \ | |
&& apt-get install -y software-properties-common \ | |
&& sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list \ | |
&& sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list \ | |
&& apt-get update \ | |
&& apt-get build-dep -y mesa | |
RUN apt-get update && apt-get -y install \ | |
libpthread-stubs0-dev \ | |
llvm-4.0-dev \ | |
python2.7 \ | |
freeglut3 freeglut3-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN apt-get update && apt-get -y install \ | |
autoconf \ | |
bison \ | |
cmake \ | |
curl \ | |
flex \ | |
g++ \ | |
pkg-config \ | |
python2.7-dev \ | |
make \ | |
cython \ | |
zlib1g-dev | |
RUN curl -L ftp://ftp.freedesktop.org/pub/mesa/mesa-18.1.7.tar.gz | tar xz \ | |
&& cd mesa-18.1.7 \ | |
&& ./configure \ | |
--prefix=/mesa/ \ | |
--enable-opengl --disable-gles1 --disable-gles2 \ | |
--disable-va --disable-xvmc --disable-vdpau \ | |
--enable-shared-glapi \ | |
--disable-texture-float \ | |
--enable-gallium-llvm --enable-llvm-shared-libs \ | |
--with-gallium-drivers=swrast,swr \ | |
--disable-dri --with-dri-drivers= \ | |
--disable-egl --with-egl-platforms= --disable-gbm \ | |
--disable-glx \ | |
--disable-osmesa --enable-gallium-osmesa \ | |
ac_cv_path_LLVM_CONFIG=/usr/bin/llvm-config-4.0 \ | |
&& make -j8 \ | |
&& make install \ | |
&& ldconfig | |
RUN cd / \ | |
&& rm -r /mesa-18.1.7 \ | |
&& apt-get purge -y --auto-remove --purge \ | |
autoconf \ | |
bison \ | |
cmake \ | |
curl \ | |
flex \ | |
g++ \ | |
pkg-config \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN apt-get update && apt-get -y install \ | |
libpython2.7 \ | |
python-pip \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Mesa | |
ENV MESA_HOME=/mesa/ | |
ENV LIBRARY_PATH=${LIBRARY_PATH}:${MESA_HOME}/lib | |
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MESA_HOME}/lib | |
ENV C_INCLUDE_PATH=${C_INCLUDE_PATH}:${MESA_HOME}/include/ | |
ENV CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:${MESA_HOME}/include/ | |
RUN pip install PyOpenGL PyOpenGL_accelerate | |
#COPY ./requirements.txt /app/requirements.txt | |
#RUN pip install -r /app/requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment