Skip to content

The meaning and purpose of the volume field of the dockerfile file #736

@cai-hd

Description

@cai-hd

When I run the container using the mysql:5.7.32 image, like this:

docker run -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7.32

When I run a new container every time. A new volume will be generated in the /var/lib/docker/volume directory,
I understand this because there is a data volume declared in the dockerfile file.

image

But I have two questions.

  1. What is the purpose of this anonymous volume ?
  2. When I started the container, the volume generated was about 200MB. I deleted the container, but the volume still exists and I need to delete it manually. What is the meaning of this design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions