91320a84 by 周伟奇

backend net host

1 parent 52ea5210
......@@ -86,6 +86,7 @@ TRITON_OPTIONS="${TRITON_ENVS_OPTION} ${TRITON_VOLUMES_OPTION} ${TRITON_PORTS_OP
# -env
BACKEND_CONTAINER_ENVS=(
"WORKER_NUM=${BACKEND_WORKER_NUM}"
"BACKEND_PORT=${BACKEND_PORT}"
)
BACKEND_ENVS_OPTION=""
if (( ${#BACKEND_CONTAINER_ENVS[@]} > 0 )); then
......@@ -102,15 +103,13 @@ if (( ${#BACKEND_CONTAINER_VOLUMES[@]} > 0 )); then
BACKEND_VOLUMES_OPTION="$(getOption "-v" ${BACKEND_CONTAINER_VOLUMES[@]})"
fi
# -p
BACKEND_CONTAINER_PORTS=(
"${BACKEND_PORT}:80"
)
BACKEND_CONTAINER_PORTS=()
BACKEND_PORTS_OPTION=""
if (( ${#BACKEND_CONTAINER_PORTS[@]} > 0 )); then
BACKEND_PORTS_OPTION="$(getOption "-p" ${BACKEND_CONTAINER_PORTS[@]})"
fi
# -env -v -p
BACKEND_OPTIONS="${BACKEND_ENVS_OPTION} ${BACKEND_VOLUMES_OPTION} ${BACKEND_PORTS_OPTION}"
BACKEND_OPTIONS="--net=host ${BACKEND_ENVS_OPTION} ${BACKEND_VOLUMES_OPTION} ${BACKEND_PORTS_OPTION}"
function checkTritonOption() {
if (( ${#TRITON_CONTAINER_ENVS[@]} > 0 )); then
......
......@@ -9,10 +9,10 @@ function _docker_run(){
if [ ${run_type} = "up" ]; then
# 启动部署用的container
all_options="-d --net=bridge ${input_options} --name ${container_name} ${image}"
all_options="-d ${input_options} --name ${container_name} ${image}"
else
# 创建debug用的container
all_options="-it --rm --net=bridge ${input_options} --entrypoint=/bin/bash ${image}"
all_options="-it --rm ${input_options} --entrypoint=/bin/bash ${image}"
fi
_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!