Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps to make Centos Image under Docker

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the steps of making Centos image under Docker". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the steps of making Centos image under Docker".

Installation dependency

Yum install febootstrap

Make

Febootstrap-I bash-I openssh-server centos6 centos6.7 http://mirrors.aliyun.com/centos/6/os/x86_64/

Ps: command to use mode febootstrap [--options] REPO TARGET [MIRROR]

-I indicates the package you want to install

Add auxiliary files

In this step, you can copy some files from your host system to the directory to be packaged, such as hosts, resolve, bashrc files, and so on. You can add them as needed.

Packing

Cd centos6.7tar-c. | docker import-centos6.7

Febootstrap doesn't have this package in centos7, but we can use supermin5 to make centos7's image

OS

CentOS Linux release 7.3.1611 (Core)

Installation dependency

Yum install supermin5

Make

Supermin5-v-prepare bash coreutils-o supermin.dsupermin5-v-build-- format chroot supermin.d-o appliance.dtar-- numeric-owner-cpf centos-7.tar-C appliance.d .cat centos-7.tar | docker import-oliver/centos:v7.2

Ps: usage mode

Supermin-- prepare-o OUTPUTDIR PACKAGE [PACKAGE...]

Supermin-- build-o OUTPUTDIR-f chroot | ext2 INPUT [INPUT...]

Parameter interpretation

-- the package that prepare wants to install

-- build compilation

-- format is available only in build mode, indicating whether the output is a chroot directory or an ext2 disk image.

-o OUTPUTDIR output directory

-- size SIZE outputs the size of the ext2 file system, which is available only in build mode.

-- use-installed

-- copy-kernel copies the kernel of the machine

Thank you for reading, the above is the content of "the steps of making Centos image under Docker". After the study of this article, I believe you have a deeper understanding of the steps of making Centos image under Docker, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report