Search code examples
dockerdockerfiledocker-run

How to create image from dockerfile without starting the container


I have a dockerfile that is suppsed to start the tomcat. I want to create and not run the image from that dockerfile so that in docker images I can see the image. docker run -it logs me in to container but I dont want to create container and log in to it.

I just want to create a image from dockerfile (without creating a container of it).

By which command can I achieve this ?


Solution

  • That would be the build command.

    https://docs.docker.com/engine/reference/commandline/build/