“删除” Dockerfile中的VOLUME [英] "Remove" a VOLUME in a Dockerfile

查看:295
本文介绍了“删除” Dockerfile中的VOLUME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Dockerfile扩展了 FROM 映像,该映像声明了 VOLUME 。有没有一种方法可以覆盖 VOLUME 指令,从而删除 VOLUME ? p>

I have a Dockerfile extending FROM an image that declares a VOLUME. Is there a way to overwrite the VOLUME directive in such a way, that it "removes" the VOLUME?

推荐答案

否。

唯一的方法是克隆用作基础映像的 Dockerfile FROM 中的映像)并删除 VOLUME 指令。然后构建它并在您的 FROM 中用作基础。

The only way to do so, is if you clone Dockerfile of the image you use as base one (the one in FROM) and remove the VOLUME directive manually. Then build it and use in your FROM as base one.

这篇关于“删除” Dockerfile中的VOLUME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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