It is currently not possible to create a container without running anything (i.e. commands). To create a new container, you need to use a base image and specify a command to run.
# Usage: sudo docker run [image name] [command to run] sudo docker run my_img echo "hello"
# To name a container instead of having long IDs # Usage: sudo docker run -name [name] [image name] [comm.] sudo docker run -name my_cont_1 my_img echo "hello"
This will output "hello" and you will be right back where you were. (i.e. your host's shell) As you can not change the command you run after having created a container (hence specifying one during "creation"), it is common practice to use process managers and even custom launch scripts to be able to execute different commands.
# Usage: sudo docker run [container ID] sudo docker run c629b7d70666
Remember how to find the containers? See above section for listing them.
# Usage: sudo docker stop [container ID] sudo docker stop c629b7d70666
This command turns your container to an image.
# Usage: sudo docker rm [container ID] sudo docker rm c629b7d70666