Skip to content

Add an UNVOLUME or UNSET VOLUME statement to cancaled mount the default parent volume #4802

@alexeyp0708

Description

@alexeyp0708

This topic has been before discussed since 2014:

Created a new topic based on recommendations moby/moby#8177 (comment)

Target: Add UNVOLUME /target/directory (or UNSET VOLUME) statement in Dockerfile.
Behavior: Removes volume metadata that is added by the parent image. If there is no metadata to delete, a warning is issued. Mounting and unmounting volumes must be applied sequentially according to the image inheritance order.

The problem exists and people suffer from it and ask for something to be done.

Reasons for change:

  1. The child image does not always need the volumes of the parent image.
  2. When changing daemon settings of parent image, developers sometimes prefer to specify their own volumes for worker processes (For example, specify a directory in a shared volume for containers.) .
    As a result, parent volumes hang like extra garbage and take up disk space (often data from the container is copied to volumes by default).
  3. The developer would prefer to have access to the folder in the container that the volume overlaps.
    But the default volume always overlaps this folder in the container and the user does not have access to it.

Please study the topic moby/moby#3465 and you will understand that there are problems. It’s just that not everyone can or wants to describe the situation that the developers encountered.

I think there are enough legal grounds to consider this problem seriously and include any option for canceling the parent default volume.

Some links:
moby/moby#33842 (comment) - VOLUME behavior in buildkit - VOLUME is now metadata
moby/moby#3465 (comment) - unmount volume via ENTRYPOINT

moby/moby#3465 (comment) - Rebuilding the image with new settings

moby/moby#3465 (comment) - Changing metadata in a built image

(UPDATED)
I have a request to the participants - reproduce your problems in detail.
If possible with examples.
It is better not to discuss unless necessary, so as not to clutter the topic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions