Github user myui commented on a diff in the pull request: https://github.com/apache/incubator-hivemall/pull/81#discussion_r117604997 --- Diff: docs/gitbook/docker/getting_started.md --- @@ -31,38 +31,73 @@ This page introduces how to run Hivemall on Docker. # 1. Build image -## Build using docker-compose +You have two options in order to build a **hivemall** docker image: + +## Using `docker-compose` - `docker-compose -f resources/docker/docker-compose.yml build` +``` +$ docker-compose -f resources/docker/docker-compose.yml build +``` -## Build using docker command +## Using `docker` command - `docker build -f resources/docker/Dockerfile .` +``` +$ docker build -f resources/docker/Dockerfile . +``` > #### Note -> You can [skip](./getting_started.html#running-pre-built-docker-image-in-dockerhub) building images by using existing Docker images. +> You can [skip](./getting_started.html#running-pre-built-docker-image-in-dockerhub) building images by using a pre-build docker image from Docker Hub. # 2. Run container -## Run by docker-compose +If you built an image by yourself, it can be launched by either `docker-compose` or `docker` command: + +## By `docker-compose` + +``` +$ docker-compose -f resources/docker/docker-compose.yml up -d && docker attach hivemall +``` + +You can edit `resources/docker/docker-compose.yml` as needed. + +For example, setting `volumes` options enables to mount your local directories to the container as follows: - 1. Edit `resources/docker/docker-compose.yml` - 2. `docker-compose -f resources/docker/docker-compose.yml up -d && docker attach hivemall` +```yml +volumes: + - "../../:/opt/hivemall/" # mount current hivemall dir to `/opt/hivemall` ($HIVEMALL_PATH) on the container + - "/path/to/data/:/root/data/" # mount resources to container-side `/root/data` directory +``` -## Run by docker command +## By `docker` command - 1. Find a local docker image by `docker images`. - 2. Run `docker run -it ${docker_image_id}`. - Refer [Docker reference](https://docs.docker.com/engine/reference/run/) for the command detail. +Find a local docker image by `docker images`, and hit: -## Running pre-built Docker image in Dockerhub +``` +$ docker run -p 8088:8088 -p 50070:50070 -p 19888:19888 -it ${docker_image_id} +``` - 1. Check [the latest tag](https://hub.docker.com/r/hivemall/latest/tags/) first. - 2. Pull pre-build docker image from Dockerhub `docker pull hivemall/latest:20170517` - 3. `docker run -p 8088:8088 -p 50070:50070 -p 19888:19888 -it hivemall/latest:20170517` +Refer [Docker reference](https://docs.docker.com/engine/reference/run/) for the command detail. + +Similarly to the `volumes` option in the `docker-compose` file, `docker run` has `--volumes` option: + +``` +$ docker run ... --volume /path/to/local/hivemall:/opt/hivemall +``` + +## Running pre-built Docker image in Docker Hub You can find pre-built Hivemall docker images in [this repository](https://hub.docker.com/r/hivemall/latest/). +1. Check [the latest tag](https://hub.docker.com/r/hivemall/latest/tags/) first --- End diff -- owner is used for repository. repository is used for branch. tag is used for versioning. hivemall:release:v0.5-rc.1 hivemall:lastest:20170502-1 hivemall:spark:20170501 owner: hivemall is used only for hivemall. So, okey as it is.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---