如何从现有的CentOS中创建Docker镜像? [英] How do I create docker image from an existing CentOS?

查看:135
本文介绍了如何从现有的CentOS中创建Docker镜像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是docker.io的新人,不知道这是否超出了码头工作者的范围。我有一个现有的CentOS 6.5系统。我试图找出如何从已经运行的CentOS Linux系统创建一个码头服务器映像。我想基本克隆这个现有的系统;所以我可以将其移植到另一个云提供商。我能够从基础CentOS映像创建一个码头服务器映像,但是我想基本上克隆我现有的系统,并使用docker.io。



我是否从头开始创建基础CentOS,并从那里配置Docker?这可能是更多的VirtualBox / Vagrant的事情,但对docker.io感兴趣。



看起来我需要从基础CentOS开始,并创建一个Docker文件与所有我需要的插件...想想我现在正到那里....

解决方案

克隆正在运行的系统当然不是Docker的意图。相反,Docker旨在开发您的操作系统和服务器安装与应用程序或服务,使DevOps更加DevOpsy。从一个干净的CentOS映像开始,您将确保只安装您需要的服务,并且一切都在控制之下。你实际上不想要所有其他可能产生不兼容性的东西。所以,这里的答案是你绝对应该在这里解决问题。


I am new to docker.io and not sure if this is beyond the scope of docker. I have an existing CentOS 6.5 system. I am trying to figure out how to create a docker image from a CentOS Linux system I already have running. I would like to basically clone this existing system; so I can port it to another cloud provider. I was able to create a docker image from a base CentOS image but I want to basically clone my existing system and use docker.io going forward.

Am I stuck with creating a base CentOS from scratch and configure it for docker from there? This might be more of a VirtualBox/Vagrant thing, but am interested in docker.io.

Looks like I need to start with base CentOS and create a Dockerfile with all the addons I need... Think I'm getting there now....

解决方案

Cloning a system that is up and running is certainly not what Docker is intended for. Instead, Docker is meant to develop your OS and server installation together with the app or service, making DevOps even more DevOpsy. By starting with a clean CentOS image, you will be sure to install only what you need for the service, and have everything under control. You actually don't want all the other stuff that might produce incompatibilities. So, the answer here is that you definitely should approach the problem here the other way around.

这篇关于如何从现有的CentOS中创建Docker镜像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆