Skip to content

Instantly share code, notes, and snippets.



Created Apr 7, 2017
What would you like to do?
FROM ubuntu:latest
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
CMD /bin/bash
# Clone the repos we need.
RUN git clone
RUN git clone
RUN git clone
# Install Moses.
WORKDIR $HOME/mosesdecoder
RUN make -f $HOME/mosesdecoder/contrib/Makefiles/install-dependencies.gmake
RUN ./ --max-kenlm-order=20 --max-factors=1000
# Install MGIZA++.
WORKDIR $HOME/mgiza/mgizapp
RUN cmake . && make && make install
RUN cp $HOME/mgiza/mgizapp/scripts/ bin/
# Install clustercat.
WORKDIR $HOME/clustercat
RUN make -j 4
# 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