Sebagai contoh untuk replikasi issue ini, mari kita buat contoh Dockerfile

FROM fedora:40 as build
USER fedora

build dengan CLI docker build . -t fedora-dev1

$ docker build . -t fedora-dev1
[+] Building 3.3s (6/6) FINISHED                                                                                                                                                                    docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                          0.1s
 => => transferring dockerfile: 73B                                                                                                                                                                           0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)                                                                                                                                0.1s
 => [internal] load metadata for docker.io/library/fedora:40                                                                                                                                                  3.0s
 => [auth] library/fedora:pull token for registry-1.docker.io                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => [1/1] FROM docker.io/library/fedora:40@sha256:5ce8497aeea599bf6b54ab3979133923d82aaa4f6ca5ced1812611b197c79eb0                                                                                            0.0s
 => exporting to image                                                                                                                                                                                        0.1s
 => => exporting layers                                                                                                                                                                                       0.0s
 => => writing image sha256:cfee09f0d6073a411f049aa9b7b9793bd0bfbde023de64cf2af02b9bdce2c466                                                                                                                  0.0s
 => => naming to docker.io/library/fedora-dev1                                                                                                                                                                0.0s
 
 1 warning found (use --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)

Solusinya adalah dengan menggunakan huruf kapital untuk keyword bawaan docker, dalam hal ini adalah keyword as menjadi AS

Ubah Dockerfile menjadi

FROM fedora:40 AS build
USER fedora

docker build berhasil

Leave a comment

Your email address will not be published. Required fields are marked *