简体   繁体   English

如何创建Docker基本映像?

[英]How to create a docker base image?

My local system is ubuntu 14.04. 我的本地系统是ubuntu 14.04。 In this local system, I installed VM which contains sles 12. In this local VM (sles 12), I configure some of the application of my use. 在此本地系统中,我安装了包含文件12的VM。在此本地VM(文件12)中,我配置了一些我要使用的应用程序。

I'm totally new to Docker. 我是Docker的新手。 I want to create a docker base image which contains this sles 12 image into which my applications are also present. 我想创建一个包含此sles 12映像的docker基本映像,我的应用程序也存在其中。

How I can create such a docker image, in which sles 12 os is available and into that my applications also can be run? 我如何创建这样的docker映像,在其中可以使用sles 12 os,还可以在其中运行我的应用程序?

The docs have a section on creating base images. 文档有一节介绍如何创建基本映像。

The FROM will still be required but you can use the reserved "scratch" name here to create a base image from scratch (nice naming there Docker) 仍然需要FROM但是您可以在此处使用保留的“ scratch”名称从头开始创建基础映像(在Docker中很好地命名)

FROM scratch
ADD hello /
CMD ["/hello"]

Taken from the section on creating a base image using scratch 取自有关使用草稿创建基本图像的部分

First of all, create a base SLES image. 首先,创建基本的SLES映像。 Luckily for you, this process is [semi]automated by SUSE through the utility called sle2docker. 幸运的是,此过程由SUSE通过名为sle2docker的实用程序自动执行。 A manual can be found here: https://www.suse.com/documentation/sles-12/book_sles_docker/data/cha_sle2docker_installation.html https://github.com/SUSE/sle2docker 可以在这里找到手册: https : //www.suse.com/documentation/sles-12/book_sles_docker/data/cha_sle2docker_installation.html https://github.com/SUSE/sle2docker

Then you should run your container, install and setup your custom software and do docker commit to create you personal customized image. 然后,您应该运行容器,安装和设置自定义软件,并执行docker commit来创建您的个人自定义映像。 https://docs.docker.com/engine/tutorials/dockerimages/ https://docs.docker.com/engine/tutorials/dockerimages/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM