How to install standard system commands for amazon-linux 2
RUN yum update && yum install -y sudo
, sudo is not installed in that image by default. you are already root in that images so you do not need sudo yum
.
the idea from not installing too many packages by default ,is to let the image as small as possible and let the user install just what he needs