All Products
Document Center

Make a Docker image

Last Updated: May 11, 2018

In addition to using the Dockerfile, you can also make a Docker image in a more intuitive way.

1. Run basic image container

  1. Logged into Ubuntu as the root user.

    1. docker run -it ubuntu
    2. root@0bab204d8f9b:/#
  2. Install required software in Ubuntu, for example:

    1. apt-get install python -y
    2. apt-get install openjdk-7-jdk
    3. ....
  3. Exit from Ubuntu after installing software.

    1. exit

2. Make an image

  1. Find the ID of the required container, for example, 41570524e867.

    1. docker ps -n 1 # List latest containers.
    2. docker commit 41570524e867 myubuntu
  2. Run the following command to check whether the image is made successfully.

    1. docker images