Create a Ubuntu base image Docker's study notes

  Before creating a base image you need to install Bootstrap tool debootstrap, so execute the command:

sudo apt install debootstrap

  After the software installation is complete you can use the tool to download Ubuntu debootstrap binary file, the command format is debootstrap <code> <Directory>. Here you can view this Ubuntu system, code-named, of course, also possible to use other versions of the code, this command through the network to download files. Excuting an order:

lsb_release -a

  Codename can see the property value bionic, bionic this is Ubuntu 18.04 LTS version of the code, I must say that the Go command: uname -a Linux kernel can see the version of the system. Know the version number, it begins to download binary files, execute the command:

sudo debootstrap bionic bionic

  After completion of the command, you can see the folder bionic inside the downloaded file

\

  Next to package it can use the downloaded file, then use the pipeline execute the command docker import import:

sudo tar -C bionic/ -c . | sudo docker import - bionic:0.1

  tar -C bionic -c. command for the contents of a document bionic directory compressed, and output to stdout. Output content can be passed to the command docker import pipeline | through. -C option to switch to the directory, -c option compression.

  Introducing import command format is: docker import <URL or -> <image name>: <tag>. When the | pipe receiving data, specify -. Execution results as shown below:

  You can see to create a mirror image of bionic: 0.1

Guess you like

Origin www.cnblogs.com/quanbisen/p/11443196.html