Fix Dockerfile Error: WARN: FromAsCasing: ‘as’ and ‘FROM’ keywords’ casing do not match

Emeka Mbah
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

--

--

Emeka Mbah
Emeka Mbah

Written by Emeka Mbah

Emeka is a seasoned software developer passionate about contributing to open-source projects.

Responses (3)