Last active
November 4, 2015 02:07
-
-
Save shiena/ef82b8b817acd7757bb4 to your computer and use it in GitHub Desktop.
docker-centos6-xfce
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 centos:6 | |
MAINTAINER Mitsuhiro Koga<shiena.jp@gmail.com> | |
ENV user ${user:-developer} | |
ENV host ${host:-192.168.99.1} | |
# Xfceのためにepelをインストール | |
# install_chrome.shのためにwgetをインストール | |
# gitをビルドするためにtar curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMakerをインストール | |
# 日本語環境、デスクトップ環境、開発環境、インターネットのためにgroupinstall | |
# 日本語環境のためにlocaldef i18n clockを変更 | |
# ${user}ユーザを追加 | |
RUN yum -y update \ | |
&& yum -y install epel-release sudo wget tar curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker \ | |
&& yum -y --enablerepo=epel groupinstall "Japanese Support" "Input Methods" "Xfce" "Development Tools" "Internet Browser" \ | |
&& yum -y remove git \ | |
&& yum clean all | |
RUN dbus-uuidgen > /var/lib/dbus/machine-id \ | |
&& localedef -f UTF-8 -i ja_JP ja_JP.UTF8 \ | |
&& sed -i -e 's/en_US/ja_JP/' /etc/sysconfig/i18n \ | |
&& cp -p /usr/share/zoneinfo/Japan /etc/localtime \ | |
&& sed -i -e 's@".*"@"Asia/Tokyo"@' /etc/sysconfig/clock | |
RUN groupadd -g 1000 ${user} \ | |
&& useradd -ms /bin/bash -u 1000 -g 1000 ${user} \ | |
&& echo "${user}:${user}" | chpasswd \ | |
&& sed -i -e 's/^\(Defaults *requiretty\)/# \1/' /etc/sudoers \ | |
&& echo "${user} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/developer \ | |
&& echo '#!/bin/sh' > /startup.sh \ | |
&& echo "sudo chown ${user}.${user} /data" >> /startup.sh \ | |
&& echo "sudo /etc/init.d/messagebus restart" >> /startup.sh \ | |
&& echo 'export XMODIFIERS="@im=ibus"' >> /startup.sh \ | |
&& echo 'export GTK_IM_MODULE=ibus' >> /startup.sh \ | |
&& echo 'export QT_IM_MODULE=ibus' >> /startup.sh \ | |
&& echo 'export LANG=ja_JP.utf8' >> /startup.sh \ | |
&& echo 'exec startxfce4' >> /startup.sh \ | |
&& chmod +x /startup.sh | |
# chromeをインストールする | |
ADD http://chrome.richardlloyd.org.uk/install_chrome.sh / | |
RUN /bin/sh install_chrome.sh -d -f \ | |
&& yum clean all \ | |
&& rm install_chrome.sh | |
# java8をインストールする | |
ENV JAVA_DL_URL http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.rpm | |
ENV JAVA_DL_PATH /usr/local/src/jdk-8u66-linux-x64.rpm | |
RUN wget -q -O ${JAVA_DL_PATH} --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" ${JAVA_DL_URL} \ | |
&& rpm -ivh ${JAVA_DL_PATH} \ | |
&& rm ${JAVA_DL_PATH} | |
# yumのgitは古いのでビルドしてインストールする | |
ENV gitver ${gitver:-2.6.2} | |
ADD https://www.kernel.org/pub/software/scm/git/git-${gitver}.tar.gz /usr/local/src/ | |
RUN tar xfz /usr/local/src/git-${gitver}.tar.gz -C /usr/local/src/ | |
WORKDIR /usr/local/src/git-${gitver} | |
RUN make prefix=/usr/local all \ | |
&& make prefix=/usr/local install | |
WORKDIR /home/${user} | |
RUN rm -rf /usr/local/src/* | |
VOLUME /data | |
USER ${user} | |
RUN ln -s /data /home/${user}/data | |
CMD ["/startup.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment