-
-
Save dasgoll/b49a5931447ed7bcff38f304681ec533 to your computer and use it in GitHub Desktop.
Docker CentOS6 image with Python 2.7.11
This file contains hidden or 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
# | |
# 2016/08/26 | |
# CentOS 6.7 + epel,remi | |
# Python 2.7 | |
# | |
FROM centos:6 | |
MAINTAINER Goll | |
# update yum | |
RUN yum update -y && \ | |
yum clean all | |
# epel repo | |
RUN yum install -y epel-release && \ | |
yum clean all | |
RUN sed -i -e "s/enabled *= *1/enabled=0/g" /etc/yum.repos.d/epel.repo | |
# remi repo | |
RUN yum install -y http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && \ | |
yum clean all | |
RUN sed -i -e "s/enabled *= *1/enabled=0/g" /etc/yum.repos.d/remi.repo | |
## rpmforge repo | |
#RUN yum install -y http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm && \ | |
# yum clean all | |
#RUN sed -i -e "s/enabled *= *1/enabled=0/g" /etc/yum.repos.d/rpmforge.repo | |
# mysql community repo | |
#RUN yum install -y http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm && \ | |
# yum clean all | |
#RUN sed -i -e "s/enabled *= *1/enabled=0/g" /etc/yum.repos.d/mysql-community.repo | |
# gcc, make, sshd, scp, sudo, unzip, tar, which | |
RUN yum install -y gcc make openssh-server openssh-clients sudo tar unzip which && \ | |
yum clean all | |
# libraries | |
RUN yum install -y bzip2-devel zlib-devel openssl-devel sqlite-devel ncurses-devel readline-devel tk-devel && \ | |
yum clean all | |
# python | |
RUN curl -O https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz && \ | |
tar xvzf Python-2.7.11.tgz && \ | |
cd Python-2.7.11 && \ | |
./configure --prefix=/opt/local && \ | |
make && make altinstall && \ | |
cd .. && \ | |
rm -r Python-2.7.11 Python-2.7.11.tgz | |
# pip, easy_install | |
RUN curl -kL https://bootstrap.pypa.io/get-pip.py | /opt/local/bin/python2.7 && \ | |
/opt/local/bin/pip2.7 install distribute | |
# for git prompt | |
RUN curl -L https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > /etc/skel/.git-completion.bash && \ | |
curl -L https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > /etc/skel/.git-prompt.sh | |
ADD ./bashrc /etc/skel/.bashrc | |
# initialize for ssh | |
RUN sed -i '/pam_loginuid\.so/s/required/optional/' /etc/pam.d/sshd | |
RUN /sbin/service sshd start | |
RUN /sbin/service sshd stop | |
# create login user | |
RUN useradd -d /home/gae -m -s /bin/bash gae | |
RUN echo gae:****gae | chpasswd | |
RUN echo 'gae ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
# timezone | |
RUN cp -p /usr/share/zoneinfo/Japan /etc/localtime | |
# symbolic links | |
RUN ln -s /opt/local/bin/python2.7 /usr/bin/python2.7 | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd","-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment