A Dockerfile can be built and run in the same way a normal container is created and run.
> docker build -t <docker_hub_user_id>/<repository_name>[:version_tag] <path_to_dockerfile>
Where -t refers to an image_tag: a unique readable name assigned to the created image by the developer for future references.
Example:
> docker build -t refebruvuser/mynpm .
And is run as:
> docker run -i -t <docker_hub_user_id>/<repository_name>[:version_tag]