Browse Source

update: 调整docker build 执行目录,由 .../pack/ 目录 调整为 .../

背景
    执行目录 为 .../pack  ,如果Dockfile 涉及拷贝父目录文件夹( COPY ../conf  ./conf ),会报错 "Forbidden path outside the build context"
    如果把 ../conf  等配置文件拷贝 的  pack目录, 需要做大量源码改动;

    调整 docker build执行目录,是最优解决方案
bak/zhoushx/master/deployEvn
zhoushx1018 3 years ago
parent
commit
da4eac9ee7
  1. 3
      Makefile

3
Makefile

@ -83,8 +83,7 @@ docker: clean buildquick
@echo CURR_MODEL_NAME=$(CURR_MODEL_NAME);
@echo GIT_BRANCH=$(GIT_BRANCH);
@if [[ $(GIT_BRANCH) = $(BRANCH_DEV) || $(GIT_BRANCH) = $(BRANCH_MASTER) ]]; then\
cd pack;\
docker build -t $(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG) .;\
docker build -t $(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG) -f pack/Dockerfile .;\
docker tag $(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG) $(ACR_PREFIX)/$(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG); \
docker push $(ACR_PREFIX)/$(CURR_MODEL_NAME):$(K8S_DEPLOY_PARAM_IMAGE_TAG); \
else \

Loading…
Cancel
Save