Skip to content

Instantly share code, notes, and snippets.

@hiropppe
Last active January 19, 2018 08:29
Show Gist options
  • Save hiropppe/4da7847b4ddccf2596873cf5051369f6 to your computer and use it in GitHub Desktop.
Save hiropppe/4da7847b4ddccf2596873cf5051369f6 to your computer and use it in GitHub Desktop.
DBPediaDockerfile
FROM ubuntu:16.04
RUN mkdir /root/_INSTALL
WORKDIR /root/_INSTALL
RUN sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://ftp.jaist.ac.jp/pub/Linux/ubuntu/%g" /etc/apt/sources.list
ENV TZ Asia/Tokyo
RUN apt-get update \
&& apt-get install -y tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& echo "${TZ}" > /etc/timezone \
&& rm /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
build-essential \
automake \
curl \
wget \
vim \
git \
net-tools \
iputils-ping \
netcat \
tcpdump \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
pkg-config \
python \
python-dev \
python-wheel \
python-mock \
swig \
rsync \
zip \
unzip \
g++ \
gfortran \
mlocate \
language-pack-ja-base \
language-pack-ja \
tree \
apt-transport-https \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
updatedb
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py
RUN pip --no-cache-dir install \
ipython \
flask==0.12.2 \
unirest==1.1.7 \
requests==2.18.4 \
SPARQLWrapper==1.8.0 \
tqdm==4.19.4 \
jedi==0.11.0 \
flake8==3.5.0 \
autopep8==1.3.3
# Install Java8
RUN add-apt-repository ppa:webupd8team/java \
&& echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \
&& apt-get update \
&& apt-get install -y oracle-java8-installer; exit 0
# Workaround for https://askubuntu.com/questions/966107/cant-install-oracle-java-8-in-ubuntu-16-04
RUN cd /var/lib/dpkg/info \
&& sed -i 's|JAVA_VERSION=8u151|JAVA_VERSION=8u162|' oracle-java8-installer.* \
&& sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/|' oracle-java8-installer.* \
&& sed -i 's|SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f"|SHA256SUM_TGZ="68ec82d47fd9c2b8eb84225b6db398a72008285fafc98631b1ff8d2229680257"|' oracle-java8-installer.* \
&& sed -i 's|J_DIR=jdk1.8.0_151|J_DIR=jdk1.8.0_162|' oracle-java8-installer.* \
&& apt-get install -y oracle-java8-installer oracle-java8-set-default
# Install Scala
RUN wget https://downloads.lightbend.com/scala/2.12.4/scala-2.12.4.deb \
&& dpkg -i scala-2.12.4.deb
# Install SBT
RUN echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 \
&& apt-get update \
&& apt-get install -y sbt
# Download maven
RUN wget http://ftp.meisei-u.ac.jp/mirror/apache/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz \
&& tar xzf apache-maven-3.5.2-bin.tar.gz \
&& mv apache-maven-3.5.2 /opt/
# Install Ruby
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv \
&& cd /root/.rbenv && src/configure && make -C src \
&& echo 'export PATH=/root/.rbenv/bin:$PATH' >> /root/.bash_profile
ENV PATH /root/.rbenv/bin:$PATH
RUN /root/.rbenv/bin/rbenv init; exit 0
RUN echo 'eval "$(rbenv init -)"' >> /root/.bash_profile \
&& . /root/.bash_profile \
&& git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build \
&& curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash \
&& rbenv install 2.5.0 \
&& rbenv global 2.5.0
RUN echo '# LANG' >> ~/.bash_profile \
&& echo 'export LANG=ja_JP.UTF-8' >> ~/.bash_profile \
&& echo '' >> ~/.bash_profile \
&& echo 'export PATH=$PATH:/opt/apache-maven-3.5.2/bin' >> ~/.bash_profile
RUN mkdir -p /root/.vim/bundle \
&& git clone https://github.com/Shougo/neobundle.vim /root/.vim/bundle/neobundle.vim
COPY ./vimrc /root/.vimrc
WORKDIR /root
## [TODO]
## 'Install FireFox for brat annotation'
# apt-get install firefox
# apt-get install fonts-takao-pgothic fonts-arphic-uming
# fc-cache -fv
# cd /usr/share/fonts/truetype/arphic
# cp -p ../takao-gothic/TakaoPGothic.ttf uming.ttc
## 'Install SimString'
# git clone https://github.com/chokkan/simstring.git
# cd simstring/
# ./autogen.sh
# ./configure
# make
# make install
# cd swig/python/
# ./prepare.sh --swig
# python setup.py build_ext
# python setup.py install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment