moby / moby/buildkit

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

Open
#4,802 12 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/dockerfile kind/enhancement
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
50

Description

This topic has been before discussed since 2014:

Created a new topic based on recommendations https://github.com/moby/moby/pull/8177#issuecomment-2022998013

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 https://github.com/moby/moby/issues/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:
https://github.com/moby/moby/issues/33842#issuecomment-1776786694 - VOLUME behavior in buildkit - VOLUME is now metadata
https://github.com/moby/moby/issues/3465#issuecomment-2018567264 - unmount volume via ENTRYPOINT

https://github.com/moby/moby/issues/3465#issuecomment-313389014 - Rebuilding the image with new settings

https://github.com/moby/moby/issues/3465#issuecomment-383416201 - 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named. Start by reviewing issues 3465 and 33842 and pull request 8177, then establish the intended UNVOLUME semantics, warning behavior, and inheritance ordering from the discussion. Done means the scope is agreed and detailed reproduction examples and acceptance criteria are available.

Written by the indexing model from the issue text.

Assessment

Tech stack
dockerfile, go
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.