YAML 格式檢查
驗證並格式化 YAML,同時檢查 Docker Compose services、ports、volumes、environment 與 depends_on。
只在瀏覽器裡處理輸入的內容不會送到伺服器。
輸入與結果
輸入的內容只存在這個瀏覽器。重新開啟可以還原上次的操作。
使用情境
- 驗證並格式化 YAML,同時檢查 Docker Compose services、ports、volumes、environment 與 depends_on。
- 以瀏覽器本機方式處理輸入,並在複製前檢查結果。
範例
- 常見輸入
services: app: image: node:20- 用此範例檢查 YAML 格式檢查 的輸入流程。
- 典型輸出
有效 YAML / Docker Compose 診斷 / YAML 部署報告- 複製前用來確認結果格式與後續檢查點。
- 附加範例
services: web: image: nginx ports: - "8080:80"- 複製前用來確認結果格式與後續檢查點。
- 附加範例
app: features: login: true audit: false- 複製前用來確認結果格式與後續檢查點。
常見錯誤
- 如果瀏覽器本機處理方式和真實輸入結構不一致,輸出不能直接信任。
- 複製的值中如果混入正式密鑰、客戶資料或內部 URL,分享前必須移除。
- 計算在瀏覽器裡完成,輸入特別長的時候出結果前可能會頓一下。
複製前確認
- 1再次比較原始輸入與輸出形態。
- 2確認目標執行環境、編碼、時區與安全政策差異。
參考資料
The YAML 1.2.2 specification says tab characters must not be used in indentation, because systems treat tabs differently. The parser here rejects tab indentation, and the tool adds a separate warning whenever a tab appears anywhere.
依據:YAML 1.2.2 (2021)
yes and no are not booleans in YAML 1.2
YAML 1.2's Core schema resolves only true and false (in their case variants) as booleans; reading yes, no, on and off as booleans was YAML 1.1. This tool follows 1.2 and keeps yes as a string, but a 1.1 tool reads the same line as true, hence the warning to quote it.
依據:YAML 1.2.2 (2021)
A Compose service needs an image or a build
In the Compose specification a service is defined by a Docker image and runtime arguments, and a build section can say how to create that image. So the tool warns when a service has neither, and when depends_on names a service that does not exist.
依據:Docker Docs, Compose file reference
常見問題
YAML 格式檢查 的輸入在哪裡處理?
可行的處理會在瀏覽器中執行,但不要輸入正式密鑰或客戶資料。
結果可以直接用於正式環境嗎?
複製前請再次確認執行環境、編碼、時區與安全政策等環境差異。