Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k views
in Technique[技术] by (71.8m points)

docker - "Remove" a VOLUME in a Dockerfile

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...