# Makefile ###### tags: `makefile` `學習紀錄` ## 基本範例 ```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 ``` ## = 和 := 的差異 *  *  * [參考網址](https://www.cnblogs.com/wanqieddy/archive/2011/09/21/2184257.html) ## [他人筆記](https://sites.google.com/site/mymakefile/makefile-yu-fa-jian-jie)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up