How do you run a Dockerfile?

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.


> docker build -t refebruvuser/mynpm .

And is run as:

> docker run -i -t <docker_hub_user_id>/<repository_name>[:version_tag]

Docker Posted May 17, 2020

You can now show your support. 😊

We use cookies to provide you with a great user experience, analyze traffic and serve targeted promotions.   Learn More   Accept