But a Dockerfile is imperative. It just lists, in order, the steps needed to build an image.
But...that too is done via the Dockerfile, via the RUN command to execute commands inside the container at run time. Or alternatively using the ENTRYPOINT command.