Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Run in docker

Yiyong Lin edited this page Jul 25, 2016 · 5 revisions

We provide two dockerfile in docker for docker users. LightLDADockerfile contains lightlda which is based multiverso-v1. MultiversoV2Dockerfile contains multiveros-v2. In this document, we use MultiversoV2Dockerfile and the application LogisticRegression as the example. You can find how to use LogisticRegression in wiki.

Install docker

install docker according to docs of docker. After you install docker, you can use the command 'docker' or 'docker --help' to look over the commands of docker.

Get docker image

This document present two ways to get docker image.

Build docker image from Dockerfile

docker build -t repo[:tag] - <dockerfile>

repo is the name of docker image. You also can add tag name to it. is the path of Dockerfile which you want to build. You can use this command to build docker image from local Dockerfile.

Example: docker build -t dmtk:v2 - MultiversoV2Dockerfile

Get docker image from public hub

We have built images in the public repository. So, you can pull the docker image by the below command.

docker pull lyysdy/dmtk:multiverso-v2

Run in a single machine

docker run -t -i repo[:tag] <program> <args>

is the path of program which we want to run. is the arguments of . repo[:tag] is the name of docker image(dmtk:v2 or lyysdy/dmtk:multiverso-v2).

Example:

docker run -t -i lyysdy/dmtk:multiverso-v2 /dmtk/build/applications/LogisticRegression config_file_path

If we want to use files which are not in docker, we can use the option '-v' to map local path to the path inside docker.

docker run -t -i -v /local/path:/path/inside/docker repo[:tag] <program> <args>

Run in multi-machine

Docker is ran as a process. So we can use mpi to run the docker process which runs LogisticRegression. We can use the option '-p' to map local port to port inside docker.

docker run -t -i -v /local/port:/port/inside/docker repo[:tag] <program> <args>