如何部署自建Docker图像,以便在本地环境中进行自己的更改? [英] How to deploy a self-building Docker image to make changes to itself in respect to the local environment?

查看:148
本文介绍了如何部署自建Docker图像,以便在本地环境中进行自己的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为一个快速回顾,docker可以作为一种特定Web服务,运行环境,虚拟机的代码或配置文件更改的方式,所有这些都是从linux终端/文本文件的舒适限制。 Docker图像是由dockerfiles制成的代码层的保存点,或者可以从需要基本图像的容器创建,无论如何都要创建。 Dockerfiles可以通过运行所有想要的任何新容器的命令和操作来自动化制作图像的构建过程,并将其卷入一个文件中。



现在这是伟大的,除了我想要进一步。构建图像,特别是那些具有依赖性的图像是非常困难的,因为1,您必须依赖于默认操作系统映像中不存在的命令,或者2,有很多其他无用的命令不需要。



现在在我的脑海里,我觉得它的可能性,但我还没有连接。 我希望得到一个docker文件,从头开始构建自己。它是复制所需的任何依赖关系,如rpm或某些东西,安装它,找到它的启动命令,并中继所有必要的依赖关系成功地创建和运行图像,没有缺陷回到docker文件。在编程意义上,

 从头开始
COPY package.rpm
运行*所需的cmds *

将运行错误反馈回文件。文件搜索当前操作系统以获取所需的依赖项并将其返回到RUN cmd。

  CMD *服务启动* 

对于CMD,我们将运行该服务,并获取其状态并将其启动命令重新进行过滤CMD部分。



这里的问题是,我不相信我可以使用docker来达到这些目的。要做一个码头建设的东西,保留它的错误,并将其过滤回到构建再次似乎有挑战性。我希望码头工厂可以配备这个,因为看起来我只能执行这样一个任务将是通过一个脚本,对可移植性因素造成严重破坏。



任何想法?

解决方案

听起来更像是一个配置系统,对我来说可以是厨师或木偶。如果你必须留在码头区,我知道有些用这些来创建图像。


As a quick recap, docker serves as a way to write code or configuration file changes for a specific web service, run environment, virtual machines, all from the cozy confines of a linux terminal/text file. Docker Images are save points of layers of code that are made from either dockerfiles or can be created from containers which require a base image to go off of anyways to create. Dockerfiles serve as a way to automate the build process of making images by running all the desired commands and actions for any new containers to be spawned with it and roll them into one file.

Now this is great and all but i want to take this a step further. Building images, especially those with dependencies are encumbersome because 1,you have to rely on commands that are either not there within the default OS image, or 2, have a lot of other useless commands to which are not needed.

Now in my head i feel like its possible but i cant make the connection just yet. My desire is to get a dockerfile to build itself from scratch (Litterally the image of scratch) and build itself according. It is to copy any dependencies that is desired so like an rpm or something, install it, find its start up command, and relay all dependencies thats needed to succesfully create and run the image with no flaw back to the docker file. In a programming sense,

FROM scratch
COPY package.rpm
RUN *desired cmds*

Run errors are fed back into a file. file searchs the current OS for the dependencies needed and returns them to the RUN cmd.

CMD *service start up*

As for that CMD, we would run the service, and get its status and filter it back its startup commands back into the CMD portion.

The problem here though is that i dont believe i can use docker to these ends. To do a docker build of something, retain its errors and filter it back into the build again seems challenging. I wish docker could come equipped with this as it would seem like my only chance of performing such a task would be through a script which wreaks havoc on the portability factor.

Any ideas?

解决方案

Sounds more like a provisioning system a la ansible, chef or puppet to me. I know some use those to create images if you have to stay in the dockerland.

这篇关于如何部署自建Docker图像,以便在本地环境中进行自己的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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