[英]How to properly run docker with Makefile
我有一個make文件:
APP_NAME=sgy-core-bdd/codeception
build: ## Build the container
docker build -t $(APP_NAME) .
run:
docker run --entrypoint /bin/bash -i -t -v $(pwd):/app $(APP_NAME)
當我執行make run
此錯誤
make: *** No rule to make target `/app', needed by `run'. Stop.
我該如何解決這個錯誤
配方行必須使用真實的TAB字符縮進。 在您的示例中,很可能該行沒有用TAB縮進。
這意味着該行:
docker run --entrypoint /bin/bash -i -t -v $(pwd):/app $(APP_NAME)
被視為制作規則,而不是配方,等同於寫作:
docker: /app $(APP_NAME)
run: /app $(APP_NAME)
--entrypoint: /app $(APP_NAME)
/bin/bash: /app $(APP_NAME)
-i: /app $(APP_NAME)
-t: /app $(APP_NAME)
-v: /app $(APP_NAME)
$(pwd): /app $(APP_NAME)
因此,當您使用make run
,它想要構建先決條件/app
和$(APP_NAME)
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.