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

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

问题描述

我有一个 Dockerfile 扩展 FROM 一个声明 VOLUME 的图像.有没有办法以这种方式覆盖 VOLUME 指令,从而删除"VOLUME?

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?

推荐答案

没有

这样做的唯一方法是,如果您克隆用作基础映像(FROM 中的那个)的 Dockerfile 并删除 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天全站免登陆