Docker Compose: Reusing an Existing Volume with external: true
A common Docker Compose problem is that a project creates a new, project-prefixed volume instead of reusing existing data, leaving containers without the expected files. Declaring the volume with external: true tells Compose to use a volume that already exists rather than creating a managed replacement. The volume must exist beforehand, or Compose reports an error, so it can be created with docker volume create. If the existing volume has a different name, the name property maps a logical key to that actual volume, though name alone does not provide the same behavior as external: true. External volumes are not backups, since they can still be deleted manually or lost to storage failure.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in