91320a84 by 周伟奇

backend net host

1 parent 52ea5210
...@@ -86,6 +86,7 @@ TRITON_OPTIONS="${TRITON_ENVS_OPTION} ${TRITON_VOLUMES_OPTION} ${TRITON_PORTS_OP ...@@ -86,6 +86,7 @@ TRITON_OPTIONS="${TRITON_ENVS_OPTION} ${TRITON_VOLUMES_OPTION} ${TRITON_PORTS_OP
86 # -env 86 # -env
87 BACKEND_CONTAINER_ENVS=( 87 BACKEND_CONTAINER_ENVS=(
88 "WORKER_NUM=${BACKEND_WORKER_NUM}" 88 "WORKER_NUM=${BACKEND_WORKER_NUM}"
89 "BACKEND_PORT=${BACKEND_PORT}"
89 ) 90 )
90 BACKEND_ENVS_OPTION="" 91 BACKEND_ENVS_OPTION=""
91 if (( ${#BACKEND_CONTAINER_ENVS[@]} > 0 )); then 92 if (( ${#BACKEND_CONTAINER_ENVS[@]} > 0 )); then
...@@ -102,15 +103,13 @@ if (( ${#BACKEND_CONTAINER_VOLUMES[@]} > 0 )); then ...@@ -102,15 +103,13 @@ if (( ${#BACKEND_CONTAINER_VOLUMES[@]} > 0 )); then
102 BACKEND_VOLUMES_OPTION="$(getOption "-v" ${BACKEND_CONTAINER_VOLUMES[@]})" 103 BACKEND_VOLUMES_OPTION="$(getOption "-v" ${BACKEND_CONTAINER_VOLUMES[@]})"
103 fi 104 fi
104 # -p 105 # -p
105 BACKEND_CONTAINER_PORTS=( 106 BACKEND_CONTAINER_PORTS=()
106 "${BACKEND_PORT}:80"
107 )
108 BACKEND_PORTS_OPTION="" 107 BACKEND_PORTS_OPTION=""
109 if (( ${#BACKEND_CONTAINER_PORTS[@]} > 0 )); then 108 if (( ${#BACKEND_CONTAINER_PORTS[@]} > 0 )); then
110 BACKEND_PORTS_OPTION="$(getOption "-p" ${BACKEND_CONTAINER_PORTS[@]})" 109 BACKEND_PORTS_OPTION="$(getOption "-p" ${BACKEND_CONTAINER_PORTS[@]})"
111 fi 110 fi
112 # -env -v -p 111 # -env -v -p
113 BACKEND_OPTIONS="${BACKEND_ENVS_OPTION} ${BACKEND_VOLUMES_OPTION} ${BACKEND_PORTS_OPTION}" 112 BACKEND_OPTIONS="--net=host ${BACKEND_ENVS_OPTION} ${BACKEND_VOLUMES_OPTION} ${BACKEND_PORTS_OPTION}"
114 113
115 function checkTritonOption() { 114 function checkTritonOption() {
116 if (( ${#TRITON_CONTAINER_ENVS[@]} > 0 )); then 115 if (( ${#TRITON_CONTAINER_ENVS[@]} > 0 )); then
......
...@@ -9,10 +9,10 @@ function _docker_run(){ ...@@ -9,10 +9,10 @@ function _docker_run(){
9 9
10 if [ ${run_type} = "up" ]; then 10 if [ ${run_type} = "up" ]; then
11 # 启动部署用的container 11 # 启动部署用的container
12 all_options="-d --net=bridge ${input_options} --name ${container_name} ${image}" 12 all_options="-d ${input_options} --name ${container_name} ${image}"
13 else 13 else
14 # 创建debug用的container 14 # 创建debug用的container
15 all_options="-it --rm --net=bridge ${input_options} --entrypoint=/bin/bash ${image}" 15 all_options="-it --rm ${input_options} --entrypoint=/bin/bash ${image}"
16 fi 16 fi
17 17
18 _notify INFO "run image ${image} with options: ${all_options}" 18 _notify INFO "run image ${image} with options: ${all_options}"
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!