In addition to using the Dockerfile, you can also make a Docker image in a more intuitive way.
Logged into Ubuntu as the root user.
docker run -it ubuntu
Install required software in Ubuntu, for example:
apt-get install python -y
apt-get install openjdk-7-jdk
Exit from Ubuntu after installing software.
Find the ID of the required container, for example, 41570524e867.
docker ps -n 1 # List latest containers.
docker commit 41570524e867 myubuntu
Run the following command to check whether the image is made successfully.