{"id":1277,"date":"2024-07-23T12:18:26","date_gmt":"2024-07-23T12:18:26","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=1277"},"modified":"2024-07-23T12:22:19","modified_gmt":"2024-07-23T12:22:19","slug":"docker-compose-external-volumes","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-external-volumes\/","title":{"rendered":"Docker Compose Externe Volumes"},"content":{"rendered":"<h1>Grundlagen zu externen Volumes in Docker Compose<\/h1>\n<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a powerful tool that simplifies the definition and management of multi-container Docker applications. One of its advanced features is the use of external volumes, which allows developers to share and persist data between containers while maintaining the flexibility to manage storage separately. In this article, we will explore what <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> external volumes are, how they differ from internal volumes, their practical uses, and best practices for implementing them in your projects.<\/p>\n<h2>Was sind Docker-Volumes?<\/h2>\n<p>Bevor wir uns mit externen Volumes befassen, ist es wichtig, das Konzept der Docker-Volumes im Allgemeinen zu verstehen. Ein <span class=\"glossaryai-tooltip glossary-term-701\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume\/\" target=\"_blank\">Docker-Volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker-Volumes sind f\u00fcr die persistente Datenspeicherung in containerisierten Anwendungen unerl\u00e4sslich. Sie erm\u00f6glichen die Trennung von Daten vom Container-Lebenszyklus, was eine einfachere Datenverwaltung und Sicherung erm\u00f6glicht.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a persistent data storage mechanism that allows you to store data generated and used by Docker containers. Unlike the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> filesystem, which is ephemeral and tied to the lifecycle of the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, volumes exist outside of the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> and can be shared across multiple containers.<\/p>\n<p>The benefits of using Docker volumes include:<\/p>\n<ol>\n<li><strong>Datenpersistenz<\/strong>: Volumes persist even if the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is stopped or removed.<\/li>\n<li><strong>Performance<\/strong>: Volumes are optimized for performance and can be managed by the <span class=\"glossaryai-tooltip glossary-term-666\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-engine\/\" target=\"_blank\">Docker Engine<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Engine ist eine Open-Source-Container-Technologie, die es Entwicklern erm\u00f6glicht, Anwendungen in leichtgewichtigen, isolierten Umgebungen namens Containern zu entwickeln, bereitzustellen und zu verwalten.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-engine\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/li>\n<li><strong>Easy Sharing<\/strong>: Volumes can be shared among multiple containers, facilitating data exchange.<\/li>\n<li><strong>Backup and Restore<\/strong>: Volumes can be easily backed up and restored, enabling data management across different environments.<\/li>\n<\/ol>\n<h2>Interne vs. externe Volumina\n\nIn der Regel werden die Volumina von Molek\u00fclen und deren Komplexen durch die van-der-Waals-Radius der Atome bestimmt. Diese Volumina werden als interne Volumina bezeichnet. Externe Volumina hingegen werden durch die van-der-Waals-Radius der Atome plus einem zus\u00e4tzlichen Radius bestimmt, der die Gr\u00f6\u00dfe der L\u00f6sungsmittelmolek\u00fcle ber\u00fccksichtigt. Die externen Volumina sind daher immer gr\u00f6\u00dfer als die internen Volumina.<\/h2>\n<p>When we talk about Docker volumes in <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, we can categorize them into two main types: internal volumes and external volumes.<\/p>\n<h3>Internal Volumes<\/h3>\n<p>Internal volumes are created and managed by <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> within the context of a specific application. When you define a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Ihrem <code>docker-compose.yml<\/code> file without specifying an existing <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will create a new <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> automatically. These volumes are linked to a particular <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service bezeichnet die Handlung, Unterst\u00fctzung oder Hilfe zu leisten, um spezifische Bed\u00fcrfnisse oder Anforderungen zu erf\u00fcllen. In verschiedenen Bereichen umfasst er Kundenservice, technischen Support und professionelle Dienstleistungen, wobei Effizienz und Nutzerzufriedenheit im Vordergrund stehen.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Ihrer Compose-Datei definiert. Ihr Geltungsbereich ist jedoch auf das Projekt beschr\u00e4nkt, und wenn Sie das Projekt entfernen, k\u00f6nnen die Volumes ebenfalls gel\u00f6scht werden.<\/p>\n<h3>Externe Datentr\u00e4ger<\/h3>\n<p>External volumes, on the other hand, are pre-existing volumes that are managed outside the context of your <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> application. You can create these volumes independently using Docker CLI commands or by defining them in a different Compose file. When you declare an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Ihrem <code>docker-compose.yml<\/code> file, you can reference it without <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> managing its lifecycle. This feature is particularly useful when you want to share a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> across multiple projects or when you need to persist data beyond the lifespan of a single application.<\/p>\n<h2>Defining External Volumes in Docker Compose<\/h2>\n<p>To define an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Ihrem <span class=\"glossaryai-tooltip glossary-term-689\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-file\/\" target=\"_blank\">Docker Compose-Datei<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Eine Docker Compose-Datei ist eine YAML-Konfigurationsdatei, die Dienste, Netzwerke und Volumes f\u00fcr Docker-Anwendungen mit mehreren Containern definiert. Sie vereinfacht die Bereitstellung und Verwaltung und erh\u00f6ht die Effizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-file\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you\u2019ll typically use the <code>volumes<\/code> key under the <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service bezeichnet die Handlung, Unterst\u00fctzung oder Hilfe zu leisten, um spezifische Bed\u00fcrfnisse oder Anforderungen zu erf\u00fcllen. In verschiedenen Bereichen umfasst er Kundenservice, technischen Support und professionelle Dienstleistungen, wobei Effizienz und Nutzerzufriedenheit im Vordergrund stehen.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that needs access to the <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. The syntax for declaring an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> looks like this:<\/p>\n<pre><code class=\"language-yaml\">version: '3.8'\n\nservices:\n  app:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\" target=\"_blank\">Bild<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Ein Bild ist eine visuelle Darstellung eines Objekts oder einer Szene, die typischerweise aus Pixeln in digitalen Formaten besteht. Es kann Informationen vermitteln, Emotionen hervorrufen und die Kommunikation \u00fcber verschiedene Medien hinweg erleichtern.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: myapp:latest\n    volumes:\n      - my_external_volume:\/data\n\nvolumes:\n  my_external_volume:\n    external: true<\/code><\/pre>\n<p>In diesem Beispiel, <code>my_external_volume<\/code> is marked as external. <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will not attempt to create it; instead, it expects that this <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> already exists.<\/p>\n<h2>Wie man externe Volumes erstellt\n\nIn diesem Abschnitt erfahren Sie, wie Sie externe Volumes erstellen k\u00f6nnen. Externe Volumes sind eine gro\u00dfartige M\u00f6glichkeit, zus\u00e4tzlichen Speicherplatz f\u00fcr Ihre Anwendungen bereitzustellen. Sie k\u00f6nnen sie verwenden, um Daten persistent zu speichern, auch wenn der Container, der die Anwendung ausf\u00fchrt, neu gestartet oder entfernt wird.\n\nSchritt 1: Erstellen Sie ein externes Volume\n\nUm ein externes Volume zu erstellen, verwenden Sie den folgenden Befehl:\n\n```\ndocker volume create \n```\n\nErsetzen Sie `` durch den gew\u00fcnschten Namen f\u00fcr Ihr Volume. Zum Beispiel:\n\n```\ndocker volume create my-volume\n```\n\nSchritt 2: Mounten Sie das Volume in einen Container\n\nSobald Sie ein externes Volume erstellt haben, k\u00f6nnen Sie es in einen Container einbinden. Verwenden Sie dazu den folgenden Befehl:\n\n```\ndocker run -v : \n```\n\nErsetzen Sie `` durch den Namen des von Ihnen erstellten Volumes, `` durch den Pfad, an dem das Volume im Container eingebunden werden soll, und `` durch den Namen des Docker-Images, das Sie verwenden m\u00f6chten. Zum Beispiel:\n\n```\ndocker run -v my-volume:\/app\/data my-image\n```\n\nIn diesem Beispiel wird das Volume `my-volume` in den Container unter dem Pfad `\/app\/data` eingebunden.\n\nSchritt 3: \u00dcberpr\u00fcfen Sie das Volume\n\nUm zu \u00fcberpr\u00fcfen, ob das Volume erfolgreich erstellt und eingebunden wurde, k\u00f6nnen Sie den folgenden Befehl verwenden:\n\n```\ndocker volume ls\n```\n\nDieser Befehl zeigt eine Liste aller verf\u00fcgbaren Volumes an. Sie sollten Ihr erstelltes Volume in der Liste sehen.\n\nFazit\n\nExterne Volumes sind eine leistungsstarke Funktion von Docker, die es Ihnen erm\u00f6glicht, Daten persistent zu speichern und zwischen Containern freizugeben. In diesem Abschnitt haben Sie gelernt, wie Sie externe Volumes erstellen und in Container einbinden k\u00f6nnen. Nutzen Sie diese Funktion, um Ihre Anwendungen flexibler und skalierbarer zu gestalten.<\/h2>\n<p>Sie k\u00f6nnen externe Volumes mit der Docker-Befehlszeilenschnittstelle erstellen. Dies kann mit dem folgenden Befehl erfolgen:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1168\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-create\/\" target=\"_blank\">docker volume erstellen<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker volume create allows users to create persistent storage that can be shared among containers. It decouples data from the container lifecycle, ensuring data integrity and flexibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-create\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my_external_volume<\/code><\/pre>\n<p>Dieser Befehl erstellt einen <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> named <code>my_external_volume<\/code> that can be used in any <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> application or any standalone <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h3>Checking Existing Volumes<\/h3>\n<p>To view existing volumes in your system, you can use the command:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1171\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-ls\/\" target=\"_blank\">docker volume ls<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Der Befehl `docker volume ls` listet alle Docker-Volumes auf dem Host auf. Dieser Befehl hilft Benutzern, persistente Datenspeicherung effizient zu verwalten, und liefert wichtige Details wie den Volumennamen und den Treiber.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-ls\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code><\/pre>\n<p>This command lists all the volumes, allowing you to verify if your external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> has been created successfully.<\/p>\n<h2>Use Cases for External Volumes<\/h2>\n<p>Externe Volumes dienen in Docker-Anwendungen verschiedenen Anwendungsf\u00e4llen. Im Folgenden sind einige g\u00e4ngige Szenarien aufgef\u00fchrt, in denen externe Volumes von Vorteil sind:<\/p>\n<h3>1. Shared Data Between Multiple Applications<\/h3>\n<p>When developing microservices or multi-tier architectures, it may be necessary to share data between different applications. External volumes allow you to define a single data source that multiple services can access without duplicating data. For instance, a user-uploaded files <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service bezeichnet die Handlung, Unterst\u00fctzung oder Hilfe zu leisten, um spezifische Bed\u00fcrfnisse oder Anforderungen zu erf\u00fcllen. In verschiedenen Bereichen umfasst er Kundenservice, technischen Support und professionelle Dienstleistungen, wobei Effizienz und Nutzerzufriedenheit im Vordergrund stehen.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> can store files in an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that is shared with a web application or an analytics <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service bezeichnet die Handlung, Unterst\u00fctzung oder Hilfe zu leisten, um spezifische Bed\u00fcrfnisse oder Anforderungen zu erf\u00fcllen. In verschiedenen Bereichen umfasst er Kundenservice, technischen Support und professionelle Dienstleistungen, wobei Effizienz und Nutzerzufriedenheit im Vordergrund stehen.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h3>2. Datenbank-Persistenz<\/h3>\n<p>In many applications, databases such as MySQL, PostgreSQL, or MongoDB require persistent storage. By using an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you can ensure that your database data is preserved even when the database <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is restarted or removed. This setup is critical in production environments where data integrity is paramount.<\/p>\n<h3>3. Umgebungskonsistenz<\/h3>\n<p>When working in development, testing, and production environments, external volumes can help ensure that the same data and file structures are used across these environments. By using external volumes, you can maintain consistency in the data your applications rely on, reducing the risk of environment-related issues.<\/p>\n<h3>4. Data Backup and Migration<\/h3>\n<p>External volumes can simplify backup and migration processes. For instance, if you need to migrate an application to a different host or cloud provider, you can manage and back up the external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> independently. This capability allows you to create snapshots or replicate the <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> without being tied to the container\u2019s lifecycle.<\/p>\n<h2>Externe Volumes verwalten<\/h2>\n<p>Die Verwaltung externer Volumes umfasst verschiedene Aufgaben wie Inspektion, Entfernung und Sicherung von Volumes. Hier sind einige Befehle, die bei der Verwaltung externer Volumes hilfreich sein k\u00f6nnen:<\/p>\n<h3>Volumes inspizieren<\/h3>\n<p>To inspect the details of an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, such as its mount point and usage, you can use:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1169\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-inspect\/\" target=\"_blank\">docker Volume inspizieren<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Der Befehl \u201eDocker Volume Inspect\u201c dient zum Abrufen detaillierter Informationen \u00fcber bestimmte Volumes in einer Docker-Umgebung. Er liefert Metadaten wie den Einh\u00e4ngepunkt, den Treiber und Optionen und unterst\u00fctzt so die effektive Verwaltung von Volumes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-inspect\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my_external_volume<\/code><\/pre>\n<h3>Removing Volumes<\/h3>\n<p>To remove a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, first ensure that no containers are using it. You can remove the <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> with the following command:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1170\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-rm\/\" target=\"_blank\">docker volume rm<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volume RM is a command used to remove one or more unused Docker volumes. It helps manage disk space by deleting volumes not associated with any containers, thereby optimizing storage efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-volume-rm\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my_external_volume<\/code><\/pre>\n<h3>Sichern von Volumes<\/h3>\n<p>To back up data from an external <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you can create a temporary <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that mounts the <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> and then <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/copy\/\" target=\"_blank\">Kopie<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY ist ein Befehl in der Computerprogrammierung und Datenverwaltung, der das Kopieren von Dateien oder Daten von einem Ort an einen anderen erm\u00f6glicht und dabei die Datenintegrit\u00e4t und -zug\u00e4nglichkeit gew\u00e4hrleistet.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the files to a backup location. For example:<\/p>\n<pre><code class=\"language-bash\">docker run --rm -v my_external_volume:\/data -v $(pwd):\/backup alpine sh -c \"cp -a \/data\/. \/backup\"<\/code><\/pre>\n<p>This command will <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/copy\/\" target=\"_blank\">Kopie<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY ist ein Befehl in der Computerprogrammierung und Datenverwaltung, der das Kopieren von Dateien oder Daten von einem Ort an einen anderen erm\u00f6glicht und dabei die Datenintegrit\u00e4t und -zug\u00e4nglichkeit gew\u00e4hrleistet.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the contents of <code>my_external_volume<\/code> in ein lokales Backup-Verzeichnis.<\/p>\n<h2>Best Practices f\u00fcr die Verwendung externer Volumes\n\nVolumes are a great way to store data outside of containers. They are designed to be independent of the container's lifecycle, so the data stored in them will persist even if the container is deleted. This makes them ideal for storing data that needs to be shared between containers or that needs to be preserved across container restarts.\n\nHowever, there are some best practices that you should follow when using volumes to ensure that your data is safe and secure. Here are some of the most important ones:\n\n1. Use unique volume names: When creating a volume, make sure to give it a unique name that is descriptive of its purpose. This will make it easier to identify and manage the volume later on.\n\n2. Use labels: Labels are key-value pairs that can be attached to volumes to provide additional metadata. They can be used to categorize volumes, track their usage, or provide other useful information. For example, you could use a label to indicate the type of data stored in a volume or the application that uses it.\n\n3. Use volume plugins: Volume plugins are extensions that provide additional functionality for volumes. They can be used to integrate with external storage systems, provide encryption, or add other features. Using a volume plugin can help you take advantage of advanced features and improve the security and reliability of your volumes.\n\n4. Use volume snapshots: Volume snapshots are point-in-time copies of a volume's data. They can be used to create backups, test changes, or recover from data loss. Using volume snapshots can help you protect your data and ensure that you can recover from unexpected events.\n\n5. Use volume encryption: Volume encryption is a feature that encrypts the data stored in a volume. It can help protect your data from unauthorized access and ensure that it remains confidential. Using volume encryption can help you meet compliance requirements and protect sensitive data.\n\n6. Use volume access controls: Volume access controls are rules that determine who can access a volume and what they can do with it. They can be used to restrict access to sensitive data, prevent accidental deletion, or enforce other security policies. Using volume access controls can help you protect your data and ensure that it is only accessed by authorized users.\n\n7. Use volume monitoring: Volume monitoring is the process of tracking the usage and performance of volumes. It can help you identify issues, optimize performance, and ensure that your volumes are being used effectively. Using volume monitoring can help you improve the reliability and efficiency of your volumes.\n\nBy following these best practices, you can ensure that your volumes are safe, secure, and reliable. They can help you protect your data, improve performance, and ensure that your applications run smoothly.<\/h2>\n<p>Although external volumes offer great flexibility, there are best practices you should consider to ensure effective management and usage:<\/p>\n<h3>1. Clear Naming Conventions<\/h3>\n<p>Adopt a clear and consistent naming convention for your volumes to avoid confusion. Use names that reflect their purpose and the application they are associated with.<\/p>\n<h3>2. Dokumenten-Volume-Nutzung<\/h3>\n<p>Always document the purpose and intended usage of external volumes, especially in larger teams or when working on open-source projects. This practice helps onboard new team members and maintains clarity.<\/p>\n<h3>3. Regular Backups<\/h3>\n<p>Implementieren Sie eine Backup-Strategie f\u00fcr Ihre externen Volumes, insbesondere f\u00fcr kritische Daten wie Datenbanken. Regelm\u00e4\u00dfige Backups k\u00f6nnen Datenverlust verhindern und die Wiederherstellung im Katastrophenfall erleichtern.<\/p>\n<h3>4. Monitor Volume Usage<\/h3>\n<p>Monitoring the disk usage of your volumes can help identify potential issues before they become critical. Utilize Docker commands to check <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\" target=\"_blank\">Band<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> sizes and ensure that you have sufficient disk space available.<\/p>\n<h3>5. Isolate Critical Data<\/h3>\n<p>Bei der Verwendung externer Volumes f\u00fcr sensible Daten sollten Sie erw\u00e4gen, diese auf dedizierten Speicherl\u00f6sungen zu isolieren, um Sicherheit und Leistung zu verbessern.<\/p>\n<h2>Fazit<\/h2>\n<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> external volumes are a powerful feature that enhances data management and sharing capabilities among containers. By allowing developers to define volumes that exist independently of their applications, they provide flexibility and persistence that is essential in modern DevOps practices. Understanding how to effectively use these external volumes can help improve your development workflows, streamline data management, and ensure that your applications are resilient and maintainable.<\/p>\n<p>By following best practices for naming, documentation, backup, and monitoring, you can harness the full potential of <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> external volumes in your projects. As you become more familiar with these concepts, you\u2019ll find that external volumes can play a crucial role in building robust and scalable containerized applications.<\/p>","protected":false},"excerpt":{"rendered":"<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose ist ein Werkzeug zur Definition und Ausf\u00fchrung von Multi-Container-Docker-Anwendungen mithilfe einer YAML-Datei. Es vereinfacht die Bereitstellung, Konfiguration und Orchestrierung von Diensten und verbessert die Entwicklungseffizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Externe Volumes erm\u00f6glichen es Ihnen, Daten zwischen Diensten auszutauschen und Persistenz \u00fcber <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">Beh\u00e4lter<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> restarts. By defining external volumes, you can manage storage independently from your containers.<\/p>","protected":false},"author":1,"featured_media":1871,"parent":0,"template":"","glossary-cat":[],"class_list":["post-1277","glossary","type-glossary","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Docker Compose External Volumes - Dockerpros<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-external-volumes\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Compose External Volumes - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"Docker Compose external volumes allow you to share data between services and maintain persistence across container restarts. By defining external volumes, you can manage storage independently from your containers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-external-volumes\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-23T12:22:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"6\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/\",\"name\":\"Docker Compose External Volumes - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg\",\"datePublished\":\"2024-07-23T12:18:26+00:00\",\"dateModified\":\"2024-07-23T12:22:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg\",\"width\":800,\"height\":600,\"caption\":\"docker-compose-external-volumes-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Glossary\",\"item\":\"https:\/\/dockerpros.com\/fr\/wiki\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker Compose External Volumes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker Compose External Volumes - Dockerpros","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-external-volumes\/","og_locale":"de_DE","og_type":"article","og_title":"Docker Compose External Volumes - Dockerpros","og_description":"Docker Compose external volumes allow you to share data between services and maintain persistence across container restarts. By defining external volumes, you can manage storage independently from your containers.","og_url":"https:\/\/dockerpros.com\/de\/wiki\/docker-compose-external-volumes\/","og_site_name":"Dockerpros","article_modified_time":"2024-07-23T12:22:19+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"6\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/","url":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/","name":"Docker Compose External Volumes - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg","datePublished":"2024-07-23T12:18:26+00:00","dateModified":"2024-07-23T12:22:19+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-external-volumes_1277.jpg","width":800,"height":600,"caption":"docker-compose-external-volumes-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-external-volumes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"Glossary","item":"https:\/\/dockerpros.com\/fr\/wiki\/"},{"@type":"ListItem","position":3,"name":"Docker Compose External Volumes"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Docker-Profis","description":"DockerPros \u2013 Ihr umfassender Docker-Ressourcen-Hub","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Docker-Profis","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary\/1277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary\/1277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/media\/1871"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/media?parent=1277"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary-cat?post=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}