Makefile

tags: makefile 學習紀錄

基本範例

#!/usr/bin/make -f IMAGE := laravel VERSION := latest .PHONY: all build rebuild shell run CUR_DIR = $(shell pwd) LARADOCK_DIR = $(CUR_DIR)/laradock # ------------------------------------------------------------------------------ # all: build # # 建置 image # build: # docker build -t=$(IMAGE):$(VERSION) . # # 不使用 cache 建置 image # rebuild: # docker build -t=$(IMAGE):$(VERSION) --no-cache . # # 執行並使用 shell 進入 container # shell: # docker run --rm -it -p 8000:8000 $(IMAGE):$(VERSION) bash # # 執行 container # run: # docker run --rm -it -p 8000:8000 $(IMAGE):$(VERSION) u: cd $(LARADOCK_DIR) && docker-compose up -d nginx mysql redis d: cd $(LARADOCK_DIR) && docker-compose down c: cd $(LARADOCK_DIR) && docker-compose exec workspace bash

= 和 := 的差異

  • Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 參考網址

他人筆記