{"id":199,"date":"2024-07-21T11:50:45","date_gmt":"2024-07-21T11:50:45","guid":{"rendered":"https:\/\/dockerpros.com\/?p=199"},"modified":"2024-07-21T11:50:45","modified_gmt":"2024-07-21T11:50:45","slug":"comment-utiliser-des-etiquettes-dans-docker","status":"publish","type":"post","link":"https:\/\/dockerpros.com\/fr\/container-creation-and-management\/how-do-i-use-labels-in-docker\/","title":{"rendered":"How do I use labels in Docker?"},"content":{"rendered":"<h1>How Do I Use Labels in Docker?<\/h1>\n<p>Docker a r\u00e9volutionn\u00e9 la mani\u00e8re dont nous d\u00e9ployons les applications en fournissant des conteneurs l\u00e9gers et portables. L'une des fonctionnalit\u00e9s puissantes de Docker est l'utilisation des \u00e9tiquettes (labels). Les labels sont des paires cl\u00e9-valeur qui vous aident \u00e0 organiser et \u00e0 g\u00e9rer efficacement les conteneurs, les images et autres objets Docker. Cet article explorera comment utiliser les labels dans Docker, leurs avantages, et quelques bonnes pratiques pour les exploiter dans vos applications conteneuris\u00e9es.<\/p>\n<h2>What Are Docker Labels?<\/h2>\n<p>Dans Docker, les labels sont des m\u00e9tadonn\u00e9es que vous pouvez attacher aux objets Docker. Ils se composent d'une cl\u00e9 et d'une valeur qui fournissent un contexte suppl\u00e9mentaire sur l'objet. Les labels peuvent \u00eatre utilis\u00e9s \u00e0 diverses fins, notamment :<\/p>\n<ul>\n<li><strong>Organizational Information<\/strong>: <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00c9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> vos images ou conteneurs avec des informations telles que le num\u00e9ro de version, le nom du mainteneur ou la finalit\u00e9.<\/li>\n<li><strong>Automatisation et Gestion<\/strong>: Some <span class=\"glossaryai-tooltip glossary-term-657\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/orchestration\/\" target=\"_blank\">orchestration<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">L'orchestration d\u00e9signe la gestion et la coordination automatis\u00e9es de syst\u00e8mes et de services complexes. Elle optimise les processus en int\u00e9grant diverses composantes, en garantissant un fonctionnement efficace et une utilisation optimale des ressources.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/orchestration\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> des outils, comme <span class=\"glossaryai-tooltip glossary-term-656\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\" target=\"_blank\">Kubernetes<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications, enhancing resource efficiency and resilience.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> and <span class=\"glossaryai-tooltip glossary-term-655\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-swarm\/\" target=\"_blank\">Docker Swarm<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Swarm est un outil d'orchestration de conteneurs qui permet de g\u00e9rer un cluster de moteurs Docker. Il simplifie la mise \u00e0 l'\u00e9chelle et le d\u00e9ploiement, en assurant haute disponibilit\u00e9 et \u00e9quilibrage de charge entre les services.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-swarm\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, utilisez des \u00e9tiquettes pour g\u00e9rer et organiser automatiquement les conteneurs.<\/li>\n<li><strong>Filtrage<\/strong>: Labels can help you filter and query Docker objects, making it easier to find specific containers or images in a large environment.<\/li>\n<\/ul>\n<p>The versatility of labels makes them an essential tool for both small projects and large-scale deployments.<\/p>\n<h2>How to Add Labels<\/h2>\n<p>Tu peux <span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">add<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">La commande ADD dans Docker est une instruction utilis\u00e9e dans les Dockerfiles pour copier des fichiers et des r\u00e9pertoires depuis une machine h\u00f4te vers une image Docker pendant le processus de construction. Elle facilite non seulement le transfert de fichiers locaux, mais offre \u00e9galement des fonctionnalit\u00e9s suppl\u00e9mentaires, telles que l'extraction automatique de fichiers compress\u00e9s et le t\u00e9l\u00e9chargement de fichiers distants via HTTP ou HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> \u00e9tiquettes pour divers objets Docker, y compris les images, les conteneurs, les r\u00e9seaux et les volumes. D\u00e9couvrons comment utiliser les \u00e9tiquettes avec chaque type d'objet.<\/p>\n<h3>1. Adding Labels to Docker Images<\/h3>\n<p>Pour <span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">add<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">La commande ADD dans Docker est une instruction utilis\u00e9e dans les Dockerfiles pour copier des fichiers et des r\u00e9pertoires depuis une machine h\u00f4te vers une image Docker pendant le processus de construction. Elle facilite non seulement le transfert de fichiers locaux, mais offre \u00e9galement des fonctionnalit\u00e9s suppl\u00e9mentaires, telles que l'extraction automatique de fichiers compress\u00e9s et le t\u00e9l\u00e9chargement de fichiers distants via HTTP ou HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> labels to a Docker <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, vous pouvez utiliser le <code><span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00c9TIQUETTE<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> instruction dans le <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. Here\u2019s an example of how to define labels in a <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-dockerfile\"># Dockerfile\nFROM ubuntu:latest\n\nLABEL version=\"1.0\"\nLABEL maintainer=\"yourname@example.com\"\nLABEL description=\"Ceci est une application d'exemple \u00e0 des fins de d\u00e9monstration.\"<\/code><\/pre>\n<p>After building the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you can see the labels by using the <code>docker inspect<\/code> command:<\/p>\n<pre><code class=\"language-bash\">docker build -t sample-app:1.0 .\ndocker inspect sample-app:1.0 | grep -i <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code><\/pre>\n<h3>2. Adding Labels to Docker Containers<\/h3>\n<p>Tu peux <span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">add<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">La commande ADD dans Docker est une instruction utilis\u00e9e dans les Dockerfiles pour copier des fichiers et des r\u00e9pertoires depuis une machine h\u00f4te vers une image Docker pendant le processus de construction. Elle facilite non seulement le transfert de fichiers locaux, mais offre \u00e9galement des fonctionnalit\u00e9s suppl\u00e9mentaires, telles que l'extraction automatique de fichiers compress\u00e9s et le t\u00e9l\u00e9chargement de fichiers distants via HTTP ou HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> labels to containers when you create them using the <code>--\u00e9tiquette<\/code> flag with the <code>docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command. For example:<\/p>\n<pre><code class=\"language-bash\">docker run -d --name my_container --label env=\"production\" --label role=\"web\" nginx<\/code><\/pre>\n<p>Tout comme avec les images, vous pouvez inspecter les <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> pour voir les \u00e9tiquettes appliqu\u00e9es :<\/p>\n<pre><code class=\"language-bash\">docker inspect my_container | grep -i <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code><\/pre>\n<h3>3. Adding Labels to Docker Networks<\/h3>\n<p>You can also <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> networks, which can be handy for identifying and organizing different <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\" target=\"_blank\">r\u00e9seau<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> types ou objectifs. Utilisez le <code>--\u00e9tiquette<\/code> flag when creating a <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\" target=\"_blank\">r\u00e9seau<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker network create --label purpose=\"backend\" my_backend_network<\/code><\/pre>\n<p>Inspecting the <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\" target=\"_blank\">r\u00e9seau<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will show you the <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> details:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1164\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-network-inspect\/\" target=\"_blank\">docker network inspect<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Network Inspect fournit des informations d\u00e9taill\u00e9es sur la configuration d'un r\u00e9seau Docker et les conteneurs qui y sont connect\u00e9s. Cette commande est essentielle pour r\u00e9soudre les probl\u00e8mes r\u00e9seau et optimiser la communication entre conteneurs.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-network-inspect\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my_backend_network | grep -i <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code><\/pre>\n<h3>4. Adding Labels to Docker Volumes<\/h3>\n<p>Similar to networks, you can <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> volumes to indicate their purpose or any other metadata:<\/p>\n<pre><code class=\"language-bash\">docker volume create --label purpose=\"data\" my_volume<\/code><\/pre>\n<p>And again, you can verify the labels using the inspect command:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1169\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-inspect\/\" target=\"_blank\">docker volume inspect<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volume Inspect est une commande utilis\u00e9e pour r\u00e9cup\u00e9rer des informations d\u00e9taill\u00e9es sur des volumes sp\u00e9cifiques dans un environnement Docker. Elle fournit des m\u00e9tadonn\u00e9es telles que le point de montage, le pilote et les options, facilitant la gestion efficace des volumes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-inspect\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my_volume | grep -i <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code><\/pre>\n<h2>Avantages de l'utilisation des labels Docker<\/h2>\n<h3>1. Organisation am\u00e9lior\u00e9e<\/h3>\n<p>Les \u00e9tiquettes vous aident \u00e0 organiser vos conteneurs, images, r\u00e9seaux et volumes en attachant des m\u00e9tadonn\u00e9es pertinentes. Cette organisation est particuli\u00e8rement b\u00e9n\u00e9fique dans les environnements avec de nombreux objets Docker.<\/p>\n<h3>2. Automatisation am\u00e9lior\u00e9e<\/h3>\n<p>In <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <span class=\"glossaryai-tooltip glossary-term-657\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/orchestration\/\" target=\"_blank\">orchestration<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">L'orchestration d\u00e9signe la gestion et la coordination automatis\u00e9es de syst\u00e8mes et de services complexes. Elle optimise les processus en int\u00e9grant diverses composantes, en garantissant un fonctionnement efficace et une utilisation optimale des ressources.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/orchestration\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> des plateformes comme <span class=\"glossaryai-tooltip glossary-term-656\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\" target=\"_blank\">Kubernetes<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications, enhancing resource efficiency and resilience.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, labels are extensively used for <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> discovery and <span class=\"glossaryai-tooltip glossary-term-697\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/load-balancing\/\" target=\"_blank\">load balancing<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">L'\u00e9quilibrage de charge est une technique essentielle de gestion de r\u00e9seau qui distribue le trafic entrant sur plusieurs serveurs. Cela garantit une utilisation optimale des ressources, minimise le temps de r\u00e9ponse et am\u00e9liore la disponibilit\u00e9 des applications.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/load-balancing\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. En \u00e9tiquetant vos conteneurs de mani\u00e8re appropri\u00e9e, vous permettez \u00e0 ces plateformes de g\u00e9rer votre d\u00e9ploiement plus efficacement.<\/p>\n<h3>3. Filtrage et recherche simplifi\u00e9s<\/h3>\n<p>Les \u00e9tiquettes vous permettent de filtrer et de rechercher rapidement des conteneurs, images ou r\u00e9seaux sp\u00e9cifiques. <code>docker ps<\/code> commande avec le <code>--filter<\/code> option, you can easily find containers based on their labels:<\/p>\n<pre><code class=\"language-bash\">docker ps --filter \"label=env=production\"<\/code><\/pre>\n<p>This command will display all running containers with the <span class=\"glossaryai-tooltip glossary-term-678\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\" target=\"_blank\">\u00e9tiquette<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">In data management and classification systems, a \"label\" serves as a descriptor that categorizes and identifies items. Labels enhance data organization, facilitate retrieval, and improve understanding within complex datasets.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/label\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <code>environnement=production<\/code>.<\/p>\n<h3>4. Documentation et Clart\u00e9<\/h3>\n<p>Les \u00e9tiquettes peuvent servir d'excellent outil de documentation. En \u00e9tiquetant les conteneurs et les images avec des informations pertinentes (telles que la version, le mainteneur et la description), vous pouvez fournir un contexte \u00e0 votre \u00e9quipe et aux futurs mainteneurs sur l'objectif et l'importance de chaque objet.<\/p>\n<h2>Best Practices for Using Docker Labels<\/h2>\n<h3>1. \u00c9tablir une convention d'\u00e9tiquetage<\/h3>\n<p>Creating a consistent labeling convention is crucial for maintaining organization. Here are some recommendations:<\/p>\n<ul>\n<li>\n<p><strong>Veuillez fournir le texte que vous souhaitez que je traduise en fran\u00e7ais.<\/strong>: Consider using prefixes to categorize labels, such as <code>app<\/code>, <code><span class=\"glossaryai-tooltip glossary-term-671\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\" target=\"_blank\">environnement<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">ENV, ou Variables d'Environnement, sont cruciales dans le d\u00e9veloppement logiciel et la configuration syst\u00e8me. Elles stockent des valeurs dynamiques qui affectent l'environnement d'ex\u00e9cution, permettant un comportement flexible des applications sur diff\u00e9rentes plateformes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code>, <code>version<\/code>, etc. For example, <code>app=my_app<\/code>, <code>environnement=production<\/code>, and <code>version=1.0<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>Sois descriptif.<\/strong>Utilisez des noms significatifs pour vos \u00e9tiquettes. Au lieu de simplement utiliser \"\u00e9tiquette1\", optez pour des libell\u00e9s qui d\u00e9crivent clairement leur fonction. <code>role<\/code>, vous pourriez utiliser <code>app.role<\/code> to indicate what role the application plays.<\/p>\n<\/li>\n<\/ul>\n<h3>2. Keep Labels Simple<\/h3>\n<p>While it\u2019s easy to get carried away with labels, it\u2019s best to keep them simple and relevant. Avoid overly complex key names and use straightforward values. This clarity will prevent confusion when managing Docker objects.<\/p>\n<h3>3. Limitez le nombre d'\u00e9tiquettes\n\nLorsque vous concevez un formulaire, il est important de limiter le nombre d'\u00e9tiquettes que vous utilisez. Trop d'\u00e9tiquettes peuvent rendre le formulaire encombr\u00e9 et difficile \u00e0 lire. Essayez de regrouper les champs li\u00e9s et d'utiliser des \u00e9tiquettes claires et concises.<\/h3>\n<p>L'application de trop d'\u00e9tiquettes peut entra\u00eener de la confusion et de l'encombrement. Bien que Docker vous permette d'utiliser plusieurs \u00e9tiquettes, il est pr\u00e9f\u00e9rable de limiter leur nombre \u00e0 ce qui est n\u00e9cessaire pour une gestion efficace.<\/p>\n<h3>4. Regularly Review and Clean Up Labels<\/h3>\n<p>Au fur et \u00e0 mesure que votre projet \u00e9volue, certaines \u00e9tiquettes peuvent devenir obsol\u00e8tes ou inutiles. Examinez r\u00e9guli\u00e8rement vos objets Docker et nettoyez toutes les \u00e9tiquettes inutiles pour maintenir la clart\u00e9.<\/p>\n<h2>Utiliser des \u00e9tiquettes avec Docker Compose<\/h2>\n<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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 is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> est un outil pour d\u00e9finir et ex\u00e9cuter des applications Docker multi-conteneurs. Vous pouvez \u00e9galement utiliser des \u00e9tiquettes dans votre <code>docker-compose.yml<\/code> fichier. Voici un exemple :<\/p>\n<pre><code class=\"language-yaml\">version: '3'\nservices:\n  web:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: nginx\n    labels:\n      <span class=\"glossaryai-tooltip glossary-term-671\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\" target=\"_blank\">environnement<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">ENV, ou Variables d'Environnement, sont cruciales dans le d\u00e9veloppement logiciel et la configuration syst\u00e8me. Elles stockent des valeurs dynamiques qui affectent l'environnement d'ex\u00e9cution, permettant un comportement flexible des applications sur diff\u00e9rentes plateformes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: production\n      role: web\n  db:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: postgres\n    labels:\n      <span class=\"glossaryai-tooltip glossary-term-671\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\" target=\"_blank\">environnement<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">ENV, ou Variables d'Environnement, sont cruciales dans le d\u00e9veloppement logiciel et la configuration syst\u00e8me. Elles stockent des valeurs dynamiques qui affectent l'environnement d'ex\u00e9cution, permettant un comportement flexible des applications sur diff\u00e9rentes plateformes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: production\n      role: database<\/code><\/pre>\n<p>To start the application with <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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 is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, vous utiliseriez :<\/p>\n<pre><code class=\"language-bash\">docker-compose up -d<\/code><\/pre>\n<p>You can then inspect the services using:<\/p>\n<pre><code class=\"language-bash\">docker-compose ps<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Docker labels are a powerful feature that can significantly enhance the management and organization of your containerized applications. By attaching metadata to your Docker objects, you improve automation, filtering, and documentation. Employing best practices, such as establishing a consistent labeling convention and regularly reviewing labels, will help you maintain clarity as your projects evolve.<\/p>\n<p>As you continue to work with Docker, consider how labels can play a role in your workflow. With the right approach, labels will prove to be an invaluable tool in managing your containerized applications effectively. As the Docker ecosystem continues to evolve, understanding and leveraging labels will ensure you stay ahead in your <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management practices.<\/p>","protected":false},"excerpt":{"rendered":"<p>Les \u00e9tiquettes dans Docker permettent d'organiser et de g\u00e9rer les conteneurs en ajoutant des m\u00e9tadonn\u00e9es. Utilisez l'option `\u2013label` lors de <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> creation or <span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">add<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">La commande ADD dans Docker est une instruction utilis\u00e9e dans les Dockerfiles pour copier des fichiers et des r\u00e9pertoires depuis une machine h\u00f4te vers une image Docker pendant le processus de construction. Elle facilite non seulement le transfert de fichiers locaux, mais offre \u00e9galement des fonctionnalit\u00e9s suppl\u00e9mentaires, telles que l'extraction automatique de fichiers compress\u00e9s et le t\u00e9l\u00e9chargement de fichiers distants via HTTP ou HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Ajouter des \u00e9tiquettes aux conteneurs existants avec `docker update`.<\/p>","protected":false},"author":1,"featured_media":338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-container-creation-and-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How do I use labels in Docker? - 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\/fr\/creation-et-gestion-de-conteneurs\/comment-utiliser-des-etiquettes-dans-docker\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do I use labels in Docker? - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"Labels in Docker provide a way to organize and manage containers by adding metadata. Use the `--label` flag during container creation or add labels to existing containers with `docker update`.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/creation-et-gestion-de-conteneurs\/comment-utiliser-des-etiquettes-dans-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-21T11:50:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.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=\"author\" content=\"dockerpros\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"dockerpros\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/\"},\"author\":{\"name\":\"dockerpros\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\"},\"headline\":\"How do I use labels in Docker?\",\"datePublished\":\"2024-07-21T11:50:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/\"},\"wordCount\":853,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg\",\"articleSection\":[\"Container Creation and Management\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/\",\"url\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/\",\"name\":\"How do I use labels in Docker? - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg\",\"datePublished\":\"2024-07-21T11:50:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg\",\"width\":800,\"height\":600,\"caption\":\"how-do-i-use-labels-in-docker-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do I use labels in Docker?\"}]},{\"@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\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@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\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\",\"name\":\"dockerpros\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"caption\":\"dockerpros\"},\"sameAs\":[\"https:\/\/dockerpros.com\/\"],\"url\":\"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comment utiliser les \u00e9tiquettes dans Docker ? - 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\/fr\/creation-et-gestion-de-conteneurs\/comment-utiliser-des-etiquettes-dans-docker\/","og_locale":"fr_FR","og_type":"article","og_title":"How do I use labels in Docker? - Dockerpros","og_description":"Labels in Docker provide a way to organize and manage containers by adding metadata. Use the `--label` flag during container creation or add labels to existing containers with `docker update`.","og_url":"https:\/\/dockerpros.com\/fr\/creation-et-gestion-de-conteneurs\/comment-utiliser-des-etiquettes-dans-docker\/","og_site_name":"Dockerpros","article_published_time":"2024-07-21T11:50:45+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg","type":"image\/jpeg"}],"author":"dockerpros","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"dockerpros","Dur\u00e9e de lecture estim\u00e9e":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#article","isPartOf":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/"},"author":{"name":"dockerpros","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4"},"headline":"How do I use labels in Docker?","datePublished":"2024-07-21T11:50:45+00:00","mainEntityOfPage":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/"},"wordCount":853,"commentCount":0,"publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"image":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg","articleSection":["Container Creation and Management"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/","url":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/","name":"Comment utiliser les \u00e9tiquettes dans Docker ? - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg","datePublished":"2024-07-21T11:50:45+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-labels-in-docker_199.jpg","width":800,"height":600,"caption":"how-do-i-use-labels-in-docker-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/container-creation-and-management\/how-do-i-use-labels-in-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"How do I use labels in Docker?"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Dockerpros","description":"DockerPros \u2013 Votre centre de ressources Docker incontournable","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":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Dockerpros","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@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\/"}},{"@type":"Person","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4","name":"professionnels Docker","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","contentUrl":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","caption":"dockerpros"},"sameAs":["https:\/\/dockerpros.com\/"],"url":"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/"}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/338"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}