如何修复 Dockerfile FromAsCasing: 'as' and 'FROM' keywords' casing do not match
问题
构建 Docker 镜像时,你看到以下警告:
fix_dockerfile.sh
1 warning found (use docker --debug to expand):
- FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2)解决方案
首先注意这只是警告,不是错误。如果你忽略它,构建仍然可以正常工作。
修复方法是找到包含 FROM 和 as 的任何行,如这一行:
Dockerfile_lowercase_as
FROM hugomods/hugo as builder并确保 FROM 和 as 都是大写:
Dockerfile_uppercase_as
FROM hugomods/hugo AS builderCheck out similar posts by category:
Docker
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow