I've create a Docker script momodock.script
that does some installation for a set of tools that I'll need to install on multiple machines:
FROM ubuntu:latest
MAINTAINER Momo <[email protected]>
LABEL description="TL;DR instructions to install Moses with Docker."
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
RUN apt-get -y upgrade
RUN apt-get install -y sudo nano
RUN apt-get install -y perl
RUN apt-get install -y python-dev python3-dev python-pip python3-pip
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
RUN apt-get install -y cmake
RUN useradd -m -p mosesdocker -s /bin/bash ubiwan
RUN usermod -aG sudo ubiwan # add user to sudo list
USER ubiwan
ENV HOME /home/ubiwan
WORKDIR $HOME
CMD /bin/bash
RUN cd $HOME
RUN git clone https://github.com/moses-smt/mosesdecoder.git
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
RUN git clone https://github.com/moses-smt/mgiza.git
WORKDIR $HOME/mgiza/mgizapp
RUN cmake .
RUN make
RUN make install
RUN cp $HOME/mgiza/mgizapp/scripts/merge_alignment.py bin/
WORKDIR $HOME
RUN git clone https://github.com/jonsafari/clustercat.git
WORKDIR $HOME/clustercat
RUN make -j 4
WORKDIR $HOME
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
And building it works smoothly:
docker build -t momo-docker.image - < momodock.script
But I've written the script like how one would emulate a human in the interactive docker environment.
Are there ways to simplify how I'm installing the required dependencies and software?
RUN
commands to a file and execute it as script? \$\endgroup\$