Linux method for creating custom Docker images

  
                

Docker is an open source project because it doesn't have the limitations of language support, frameworks, and packaging systems, so it's very widely used, and users can install Docker on their own computers. For Docker, many people know to create their own Docker image. So how do you create it? Now Xiaobian teaches you how to create it.

A Docker image is a read-only layer that cannot be changed. Docker uses the Union File System to add a readable and writable file system to a read-only file system, but all changes occur at the topmost writable layer, and the original files on the read-only image under it remain unchanged. Since the image does not change, there is no state. A base image is one that has no parent class. The main benefit of the Docker base image is that it allows us to have a standalone Linux operating system.

Create a Docker image method:

1. Create a Docker with the Tar base image

We can use tar to build our own base image, we run from one The Linux distribution in the beginning begins to be packaged as a base image. This process can be a bit different, depending on the distribution we are going to build. Debootstrap is pre-released in the Debian distribution. Before starting the next steps, we need to install debootstrap. Debootstrap is used to get the packages needed to build the basic system. Here, we build an image based on Ubuntu 14.04 <;Trusty". To do this, we need to run the following command in a terminal or shell.

$ sudo debootstrap trusty trusty ” /dev/null

$ sudo tar -C trusty -c .

Copyright © Windows knowledge All Rights Reserved