-
Notifications
You must be signed in to change notification settings - Fork 17
/
run.sh
executable file
·38 lines (27 loc) · 995 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash -x
# Reference: https://docs.docker.com/engine/userguide/containers/dockerimages/
echo "Usage: "
echo " ${0} <instanceName>"
echo
imageTag=openkbs/docker-spark-bde2020-zeppelin
#version=2.1.0-hadoop2.8-hive-java8
version=latest
dockerVolume_Data=data
#docker_volume_config=config
dockerVolume_Notebook=notebook
targetHome=${ZEPPELIN_HOME:-/usr/bin/zeppelin}
local_dir=${HOME}/data-docker/$(basename ${imageTag})
#instanceName=my-${1:-${imageTag%/*}}_$RANDOM
instanceName=my-${1:-${imageTag##*/}}
mkdir -p ./data
echo "(example)"
docker run --rm -it --name ${instanceName} \
-p 29090:8080 \
-v ${local_dir}/${dockerVolume_Notebook}:${targetHome}/${dockerVolume_Notebook} \
-v ${local_dir}/${dockerVolume_Data}:${targetHome}/${dockerVolume_Data} \
${imageTag}
echo ">>> Docker Status"
docker ps -a |grep zeppelin
echo "-----------------------------------------------"
echo ">>> Docker Shell into Container `docker ps -lq`"
#docker exec -it ${instanceName} /bin/bash