Skip to content

Instantly share code, notes, and snippets.

@alvations alvations/momo.dock
Created Apr 7, 2017

Embed
What would you like to do?
FROM ubuntu:latest
MAINTAINER Momo <mo@mo.com>
LABEL description="TL;DR instructions to install Moses with Docker."
# Update Ubuntu.
RUN apt-get update
RUN apt-get install -y apt-utils debconf-utils
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get -y upgrade
# Install some necessary tools.
RUN apt-get install -y sudo nano perl python-dev python3-dev python-pip python3-pip curl wget tar dtrx
# Install Moses dependencies.
RUN apt-get install -y libboost-all-dev
RUN apt-get install -y build-essential git-core pkg-config automake libtool wget zlib1g-dev python-dev libbz2-dev cmake
# Create user account.
RUN useradd -m -p mosesdocker -s /bin/bash ubiwan
RUN usermod -aG sudo ubiwan # add user to sudo list
# Set user as default login.
USER ubiwan
ENV HOME /home/ubiwan
WORKDIR $HOME
CMD /bin/bash
# Clone the repos we need.
RUN cd $HOME
RUN git clone https://github.com/moses-smt/mosesdecoder.git
RUN git clone https://github.com/moses-smt/mgiza.git
RUN git clone https://github.com/jonsafari/clustercat.git
# Install Moses.
WORKDIR $HOME/mosesdecoder
RUN make -f $HOME/mosesdecoder/contrib/Makefiles/install-dependencies.gmake
RUN ./compile.sh --max-kenlm-order=20 --max-factors=1000
WORKDIR $HOME
# Install MGIZA++.
WORKDIR $HOME/mgiza/mgizapp
RUN cmake . && make && make install
RUN cp $HOME/mgiza/mgizapp/scripts/merge_alignment.py bin/
WORKDIR $HOME
# Install clustercat.
WORKDIR $HOME/clustercat
RUN make -j 4
WORKDIR $HOME
# Clean up the container.
RUN mkdir moses-training-tools
RUN cp mgiza/mgizapp/bin/* moses-training-tools/
RUN cp clustercat/bin/clustercat moses-training-tools/
RUN cp clustercat/bin/mkcls moses-training-tools/mkcls-clustercat
RUN mv moses-training-tools/mkcls moses-training-tools/mkcls-original
RUN cp moses-training-tools/mkcls-clustercat moses-training-tools/mkcls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.