爲了找 dockerfile 哪一個步驟造成 php 版本被改變,我在檔案內加了不少 RUN php -v,但是發現都沒有顯示結果,查資料才知道需要下 --progress 參數
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")指令執行起來會像這樣:
docker --progress=plain --no-cache XXX build
docker compose --progress=plain --no-cache XXX build 或者也可以利用環境變數 BUILDKIT_PROGRESS 取代這個 flag
export BUILDKIT_PROGRESS=plain