The CMD command is used to specify which command should be executed once the container is started. For example, if you want to run a Java application using the standard java -jar command, you will need to add the following line to the file:
CMD java - jar your-application.jar
Once you have completed your Dockerfile, you should run the build command to create the image locally, as shown in the following code:
docker build -t <docker-image-name>