Dockerfile specifies how the image is.built, but not its name
From your image list, I’d guess you ran this command: docker build . -t build-nginx
This tells Docker to build the image and tag it as “build-nginx:latest”
The reason nginx is still in your list would probably be because it was pulled outside of the build context