如何“未申报”码头图像中的卷? [英] How to "undeclare" volumes in docker image?

查看:121
本文介绍了如何“未申报”码头图像中的卷?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Docker文件,用于设置用于测试Web应用程序的映像。我将它放在tutum /灯图像上( https:// github。 com / tutumcloud / tutum-docker-lamp / blob / master / Dockerfile ),因为这似乎是一个很好的开始。

I am writing a Dockerfile for setting up an image for testing a web application. I am basing it on the tutum/lamp image (https://github.com/tutumcloud/tutum-docker-lamp/blob/master/Dockerfile) because that seems to be a good base to start from.

作为我的dockerfile,我想创建一个mysql数据库,并在其中设置一些东西。然而,tutum /灯图像声明 VOLUME [/ etc / mysql,/ var / lib / mysql] ,所以如果我理解正确,我的任何更改对于Docker文件中的MySQL数据库不会被持久化。

As part of my dockerfile, I want to create a mysql database and set up some stuff in it. However, the tutum/lamp image declares VOLUME ["/etc/mysql", "/var/lib/mysql" ], so if I understand correctly, any changes that I make to the MySQL database in the Dockerfile will not be persisted.


  • 我的理解是否正确?

如果是,


  • 有没有办法取消声明这些卷那些目录会像其他文件一样成为工会文件系统的一部分?

谢谢!

推荐答案

您不能真正取消声明卷,但您可以通过修改它的docker文件来构建您自己的原始图像版本。

You can't really undeclare a volume, but you can build your own version of the original image by modifying it's dockerfile.

这篇关于如何“未申报”码头图像中的卷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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