Run a Docker image as a container

后端 未结 11 2054
终归单人心
终归单人心 2020-12-04 04:27

After building a Docker image from a dockerfile, I see the image was built successfully, but what do I do with it? Shouldn\'t i be able to run it as a container

11条回答
  •  天命终不由人
    2020-12-04 05:13

    Do the following steps:

    1. $ docker images

      You will get a list of all local Docker images with the tags specified.

    2. $ docker run image_name:tag_name

      If you didn't specify tag_name it will automatically run an image with the 'latest' tag.

      Instead of image_name, you can also specify an image ID (no tag_name).

提交回复
热议问题