FROM centos:centos6 MAINTAINER Robert Cowham "rcowham@perforce.com" RUN yum update -y; \ # Tools required to compile and build Python \ yum install -y sudo; \ yum install -y wget; \ yum groupinstall -y "Development tools"; \ yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel; \ echo /usr/local/lib>> /etc/ld.so.conf; \ sed -ie "s/^Defaults[ \t]*requiretty/#Defaults requiretty/g" /etc/sudoers # Python 3.3 required - there is apt-get package for Python 3.2 but that is a dodgy release with bugs for P4Python etc. RUN cd /tmp; \ wget -q http://www.python.org/ftp/python/3.3.6/Python-3.3.6.tar.xz; \ tar xJf ./Python-3.3.6.tar.xz; \ cd ./Python-3.3.6; \ ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"; \ make; \ make altinstall; \ cd /tmp; \ rm -rf ./Python-3.3.6.xz ./Python-3.3.6 # Build P4Python RUN cd /tmp; \ mkdir p4python; \ cd p4python; \ wget -q ftp://ftp.perforce.com/perforce/r15.1/bin.linux26x86_64/p4api.tgz; \ tar xzf p4api.tgz; \ wget -q ftp://ftp.perforce.com/perforce/r15.1/bin.tools/p4python.tgz; \ tar xzf p4python.tgz; \ P4PYTHON_PATH=`find /tmp/p4python/ -name "p4python-*"`; \ cd $P4PYTHON_PATH; \ API_PATH=`find /tmp/p4python/ -name "p4api-*" -type d`; \ mv setup.cfg setup.cfg.bak; \ echo [p4python_config] > setup.cfg; \ echo p4_api=$API_PATH>> setup.cfg; \ /usr/local/bin/python3.3 setup.py install; \ cd /tmp; \ rm -rf $P4PYTHON_PATH p4api.tgz p4python.tgz