Since docker images are trimmed to bare minimum configuration so that it can be lightweight therefore no editor is installed with the shipped container. That's why there's a need to install it manually. You can use below command to install an editor.
docker exec -it <container> bash
apt-get install vim
or use the following Dockerfile:
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]