Fix Dockerfile Error: WARN: FromAsCasing: ‘as’ and ‘FROM’ keywords’ casing do not match
Jun 30, 2024
Are you here because of the error message above when building the Dockerfile?
Dockerfile keywords can be written in uppercase or lowercase, but it’s best not to mix them for clarity. This rule highlights instances where mixed case is used in a FROM
instruction that includes the AS
keyword to specify a stage name.
Some recent versions of Docker require the FromAsCasing keyword to be in uppercase.
Quick Fix:
Use upper case for FromAsCasing (AS), for example:
# Use the Ubuntu image and name the stage "builder"
FROM ubuntu:latest AS builder