docs: Update docker.md

This commit is contained in:
1ambda 2017-04-20 00:10:57 +09:00
parent ced897f0ee
commit 69a0b1fefd
2 changed files with 25 additions and 34 deletions

View file

@ -27,44 +27,35 @@ limitations under the License.
This document contains instructions about making docker containers for Zeppelin. It mainly provides guidance into how to create, publish and run docker images for zeppelin releases.
## Quick Start
### Installing Docker
You need to [install docker](https://docs.docker.com/engine/installation/) on your machine.
### Creating and Publishing Zeppelin docker image
* In order to be able to create and/or publish an image, you need to set the **DockerHub** credentials `DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_EMAIL` variables as environment variables.
* To create an image for some release use :
`create_release.sh <release-version> <git-tag>`.
* To publish the created image use :
`publish_release.sh <release-version> <git-tag>`
### Running a Zeppelin docker image
* To start Zeppelin, you need to pull the zeppelin release image:
```
docker pull ${DOCKER_USERNAME}/zeppelin-release:<release-version>
docker run --rm -it -p 7077:7077 -p 8080:8080 ${DOCKER_USERNAME}/zeppelin-release:<release-version> -c bash
```
* Then a docker container will start with a Zeppelin release on path :
`/usr/local/zeppelin/`
* Run zeppelin inside docker:
```
/usr/local/zeppelin/bin/zeppelin.sh
```
* To Run Zeppelin in daemon mode
Mounting logs and notebooks zeppelin to folders on your host machine
### Running docker image
```
docker run -p 7077:7077 -p 8080:8080 --privileged=true -v $PWD/logs:/logs -v $PWD/notebook:/notebook \
-e ZEPPELIN_NOTEBOOK_DIR='/notebook' \
-e ZEPPELIN_LOG_DIR='/logs' \
-d ${DOCKER_USERNAME}/zeppelin-release:<release-version> \
/usr/local/zeppelin/bin/zeppelin.sh
docker run -p 8080:8080 --name zeppelin zeppelin:<release-version>
```
* Zeppelin will run at `http://localhost:8080`.
If you want to specify `logs` and `notebook` dir,
```
docker run -p 8080:8080 \
-v $PWD/logs:/logs \
-v $PWD/notebook:/notebook \
-e ZEPPELIN_LOG_DIR='/logs' \
-e ZEPPELIN_NOTEBOOK_DIR='/notebook' \
--name zeppelin zeppelin:<release-version> # e.g '0.7.1'
```
### Building dockerfile locally
```
cd $ZEPPELIN_HOME
cd scripts/docker/zeppelin
./create-dockerfile.sh <release-version> # e.g '0.7.1'
```

View file

@ -46,7 +46,7 @@ RUN echo "$LOG_TAG Install java8" && \
rm -rf /var/cache/oracle-jdk8-installer
# should install conda first before numpy, matploylib since pip and python will be installed by conda
RUN echo "$LOG_TAG Install miniconda3 related packages" && \
RUN echo "$LOG_TAG Install miniconda2 related packages" && \
apt-get -y update && \
apt-get install -y bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
@ -87,4 +87,4 @@ RUN echo "$LOG_TAG Install R related packages" && \
Rscript -e "library('devtools'); library('Rcpp'); install_github('ramnathv/rCharts')"
ENTRYPOINT [ "/usr/bin/tini", "--" ]
CMD [ "/bin/bash" ]
CMD [ "/bin/bash" ]