简体   繁体   English

dockerfile中的信息在哪里?

[英]Where is information from dockerfile located?

There is a container, that a lot of work was done on (partly within dockerfile, partly within container itself-blatant approach from within) and it got detached from dockerfile. 有一个容器,完成了很多工作(部分在dockerfile内,部分在内部使用容器本身公然的方法),并且它与dockerfile分离。 Anyone knows where docker stores information, collected from ENTYPOINT? 有人知道docker在哪里存储从ENTYPOINT收集的信息吗? It's probably some file docker creates, that is been started upon docker start [container] and docker run -it [container sum] . 可能是docker创建的某个文件,该文件是在docker start [container] and docker run -it [container sum] Need to edit that and really don't want to start from the beginning. 需要对其进行编辑,并且真的不想从头开始。 Pretty sure don't need to, cause one can work on containers without having original dockerfile. 可以肯定不需要,因为可以在没有原始dockerfile的情况下在容器上工作。

General documentation on docker site doesn't give any insight into that Docker站点上的常规文档未对此提供任何见解

I was advised to directly edit /var/lib/docker/container/[container #]/config.v2.json Tried that and the result is the following: If I edit Entrypoint (I'll try to provide image how it looks) - s7.photobucket.com/user/309339939/media/docker.jpg.html 建议我直接编辑/var/lib/docker/container/[container #]/config.v2.json尝试,结果如下:如果我编辑Entrypoint(我将尝试提供图像外观) -s7.photobucket.com/user/309339939/media/docker.jpg.html

It doesn't help, since the value isn't saved to new after docker commit . 这没有帮助,因为在docker commit之后,该值不会保存为new。 However, if I change cmd , then it is saved. 但是,如果我更改cmd ,则将其保存。 Conclusion: Entrypoint depends on something else besides that file. 结论:入口点还依赖于该文件以外的其他内容。 Any ideas? 有任何想法吗?

Docker does not save it's data in the form of a Dockerfile, this file is an input that is "compiled" into the layers and configuration of an image. Docker不会以Dockerfile的形式保存其数据,该文件是“编译”到映像的层和配置中的输入。 There are several things you can do to get an idea of the changes, but rebuilding another Dockerfile will be a process that needs to be done by hand: 您可以通过几件事来了解更改,但是重建另一个Dockerfile将是一个需要手动完成的过程:

  • docker history will give you a list of all the layers and their commands, though many of these commands may not be easily reproducible if outside data was used or you committed a container. docker history将为您提供所有层及其命令的列表,尽管如果使用外部数据或您提交了容器,这些命令中的许多命令可能不容易重现。

  • docker diff will show the changes to the filesystem by a container. docker diff将显示容器对文件系统的更改。 This is essentially what goes into each layer of a docker image when you build it. 本质上,这就是构建它时进入Docker映像每一层的内容。

  • docker inspect will give you all the environment settings and other configurations of an image or container. docker inspect将为您提供图像或容器的所有环境设置以及其他配置。

  • docker save will export an image into a tar format that can be later loaded back into another docker engine. docker save会将图像导出为tar格式,随后可以加载回另一个docker引擎。

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

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