@@ -107,40 +107,40 @@ docker_run() {
107107 ENV_FILE=$( get_list_of_che_system_environment_variables)
108108 docker run -d --name " ${CHE_SERVER_CONTAINER_NAME} " \
109109 -v /var/run/docker.sock:/var/run/docker.sock:Z \
110- -v /home/user/che/lib:/home/user/che/lib-copy:Z \
110+ -v " $CHE_DATA_LOCATION " \
111111 -p " ${CHE_PORT} " :8080 \
112112 --restart=" ${CHE_RESTART_POLICY} " \
113113 --user=" ${CHE_USER} " \
114- --env-file=$ENV_FILE \
115- -v " $CHE_STORAGE_LOCATION " " $@ "
114+ -e " CHE_LOG_LEVEL=${CHE_LOG_LEVEL} " \
115+ -e " CHE_IP=$CHE_HOST_IP " \
116+ --env-file=$ENV_FILE " $@ "
116117
117118 rm -rf $ENV_FILE > /dev/null
118119}
119120
120- docker_run_with_storage () {
121+ docker_run_if_in_vm () {
122+ # If the container will run inside of a VM, additional parameters must be set.
123+ # Setting CHE_IN_VM=true will have the che-server container set the values.
121124 if is_docker_for_mac || is_docker_for_windows || is_boot2docker; then
122- # If on docker for mac or windows, then we have to use these special parameters
123- docker_run -e " CHE_WORKSPACE_STORAGE=$CHE_DATA_FOLDER /workspaces" \
124- -e " CHE_WORKSPACE_STORAGE_CREATE_FOLDERS=false" " $@ "
125+ docker_run -e " CHE_IN_VM=true" " $@ "
125126 else
126- # Otherwise, mount the full directory
127- docker_run -v " $CHE_WORKSPACE_LOCATION " " $@ "
127+ docker_run " $@ "
128128 fi
129129}
130130
131- docker_run_with_local_binary () {
132- if has_local_binary_path ; then
133- docker_run_with_storage -v " $CHE_LOCAL_BINARY_LOCATION " " $@ "
131+ docker_run_with_assembly () {
132+ if has_assembly ; then
133+ docker_run_if_in_vm -v " $CHE_ASSEMBLY_LOCATION " -e " CHE_ASSEMBLY= ${CHE_ASSEMBLY} " " $@ "
134134 else
135- docker_run_with_storage " $@ "
135+ docker_run_if_in_vm " $@ "
136136 fi
137137}
138138
139139docker_run_with_conf () {
140140 if has_che_conf_path; then
141- docker_run_with_local_binary -v " $CHE_CONF_LOCATION " -e " CHE_LOCAL_CONF_DIR=/conf " " $@ "
141+ docker_run_with_assembly -v " $CHE_CONF_LOCATION " -e " CHE_LOCAL_CONF_DIR=${CHE_CONF} " " $@ "
142142 else
143- docker_run_with_local_binary " $@ "
143+ docker_run_with_assembly " $@ "
144144 fi
145145}
146146
@@ -154,9 +154,12 @@ docker_run_with_external_hostname() {
154154
155155docker_run_with_debug () {
156156 if has_debug && has_debug_suspend; then
157- docker_run_with_external_hostname -p " ${CHE_DEBUG_SERVER_PORT} " :8000 -e " JPDA_SUSPEND=y" " $@ "
157+ docker_run_with_external_hostname -p " ${CHE_DEBUG_SERVER_PORT} " :8000 \
158+ -e " CHE_DEBUG_SERVER=true" \
159+ -e " JPDA_SUSPEND=y" " $@ "
158160 elif has_debug; then
159- docker_run_with_external_hostname -p " ${CHE_DEBUG_SERVER_PORT} " :8000 " $@ "
161+ docker_run_with_external_hostname -p " ${CHE_DEBUG_SERVER_PORT} " :8000 \
162+ -e " CHE_DEBUG_SERVER=true" " $@ "
160163 else
161164 docker_run_with_external_hostname " $@ "
162165 fi
@@ -179,15 +182,15 @@ has_debug() {
179182}
180183
181184has_che_conf_path () {
182- if [ " ${CHE_CONF_FOLDER } " = " " ]; then
185+ if [ " ${CHE_CONF } " = " " ]; then
183186 return 1
184187 else
185188 return 0
186189 fi
187190}
188191
189- has_local_binary_path () {
190- if [ " ${CHE_LOCAL_BINARY } " = " " ]; then
192+ has_assembly () {
193+ if [ " ${CHE_ASSEMBLY } " = " " ]; then
191194 return 1
192195 else
193196 return 0
@@ -354,13 +357,13 @@ get_container_debug() {
354357}
355358
356359get_che_container_host_ip_from_container () {
357- BINDS=$( docker inspect --format=" {{.Config.Cmd }}" " ${1} " | cut -d ' [' -f 2 | cut -d ' ]' -f 1)
360+ BINDS=$( docker inspect --format=" {{.Config.Env }}" " ${1} " | cut -d ' [' -f 2 | cut -d ' ]' -f 1)
358361
359362 IFS=$' '
360363 for SINGLE_BIND in $BINDS ; do
361364 case $SINGLE_BIND in
362- * --remote * )
363- echo $SINGLE_BIND | cut -f2 -d" : "
365+ * CHE_IP * )
366+ echo $SINGLE_BIND | cut -f2 -d=
364367 ;;
365368 * )
366369 ;;
0 commit comments