Because docker images usually contain only the bare minimum. In case of an Ubuntu image, it contains only the base system without GUI (which is rarely used in containers) and without most tools. Ubuntu’s docker image is actually relatively big; there are much smaller ones.