未验证 提交 768ee9f5 编写于 作者: J Jiawei Wang 提交者: GitHub

Merge pull request #1575 from bjjwwang/develop

fix runtime docker gen
...@@ -11,7 +11,7 @@ function usage ...@@ -11,7 +11,7 @@ function usage
echo " --python : python version, 3.6/3.7/3.8 "; echo " --python : python version, 3.6/3.7/3.8 ";
#echo " --serving : serving version(0.6.0/0.6.2)"; #echo " --serving : serving version(0.6.0/0.6.2)";
#echo " --paddle : paddle version(2.1.0/2.2.0)" #echo " --paddle : paddle version(2.1.0/2.2.0)"
echo " --image_name : image name(default serving_runtime:env-python)" echo " --image_name : image name(default serving_runtime:env-python)";
echo " -h | --help : helper"; echo " -h | --help : helper";
} }
...@@ -41,7 +41,7 @@ function parse_args ...@@ -41,7 +41,7 @@ function parse_args
positional_2="${args[1]}" positional_2="${args[1]}"
# validate required args # validate required args
if [[ -z "${paddle}" || -z "${env}" || -z "${python}" || -z "${serving}" ]]; then if [[ -z "${env}" || -z "${python}" ]]; then
echo "Invalid arguments. paddle or env or python or serving is missing." echo "Invalid arguments. paddle or env or python or serving is missing."
usage usage
exit; exit;
...@@ -57,6 +57,8 @@ function parse_args ...@@ -57,6 +57,8 @@ function parse_args
function run function run
{ {
python="2.2.0"
serving="0.7.0"
parse_args "$@" parse_args "$@"
echo "named arg: env: $env" echo "named arg: env: $env"
...@@ -69,8 +71,6 @@ function run ...@@ -69,8 +71,6 @@ function run
elif [ $env == "cuda11.2" ]; then elif [ $env == "cuda11.2" ]; then
base_image="nvidia\/cuda:11.2.0-cudnn8-runtime-ubuntu16.04" base_image="nvidia\/cuda:11.2.0-cudnn8-runtime-ubuntu16.04"
fi fi
python="2.2.0"
serving="0.7.0"
echo "base image: $base_image" echo "base image: $base_image"
echo "named arg: python: $python" echo "named arg: python: $python"
echo "named arg: serving: $serving" echo "named arg: serving: $serving"
...@@ -78,7 +78,8 @@ function run ...@@ -78,7 +78,8 @@ function run
echo "named arg: image_name: $image_name" echo "named arg: image_name: $image_name"
sed -e "s/<<base_image>>/$base_image/g" -e "s/<<python_version>>/$python/g" -e "s/<<run_env>>/$env/g" -e "s/<<serving_version>>/$serving/g" -e "s/<<paddle_version>>/$paddle/g" tools/Dockerfile.runtime_template > Dockerfile.tmp sed -e "s/<<base_image>>/$base_image/g" -e "s/<<python_version>>/$python/g" -e "s/<<run_env>>/$env/g" -e "s/<<serving_version>>/$serving/g" -e "s/<<paddle_version>>/$paddle/g" tools/Dockerfile.runtime_template > Dockerfile.tmp
docker build --network=host --build-arg ftp_proxy=http://172.19.57.45:3128 --build-arg https_proxy=http://172.19.57.45:3128 --build-arg http_proxy=http://172.19.57.45:3128 --build-arg HTTP_PROXY=http://172.19.57.45:3128 --build-arg HTTPS_PROXY=http://172.19.57.45:3128 -t $image_name -f Dockerfile.tmp . #docker build --network=host --build-arg ftp_proxy=http://172.19.57.45:3128 --build-arg https_proxy=http://172.19.57.45:3128 --build-arg http_proxy=http://172.19.57.45:3128 --build-arg HTTP_PROXY=http://172.19.57.45:3128 --build-arg HTTPS_PROXY=http://172.19.57.45:3128 -t $image_name -f Dockerfile.tmp .
docker build -t $image_name -f Dockerfile.tmp .
} }
run "$@"; run "$@";
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册