{"id":1352,"date":"2024-07-23T12:37:40","date_gmt":"2024-07-23T12:37:40","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=1352"},"modified":"2024-07-23T12:37:40","modified_gmt":"2024-07-23T12:37:40","slug":"plateforme-du-dockerfile","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-platform\/","title":{"rendered":"Dockerfile \u2013platform"},"content":{"rendered":"<h1>Comprendre <code>--plateforme<\/code> Drapeau dans Dockerfile : Une exploration avanc\u00e9e\n\nDockerfile est un outil puissant pour cr\u00e9er des images Docker personnalis\u00e9es. Il permet aux d\u00e9veloppeurs de d\u00e9finir les \u00e9tapes n\u00e9cessaires pour construire une image, y compris l'installation de logiciels, la configuration de l'environnement et la copie de fichiers. Cependant, il existe une fonctionnalit\u00e9 moins connue mais tr\u00e8s utile dans Dockerfile : les drapeaux.\n\nLes drapeaux dans Dockerfile sont des instructions sp\u00e9ciales qui peuvent \u00eatre utilis\u00e9es pour modifier le comportement de certaines commandes. Ils sont g\u00e9n\u00e9ralement utilis\u00e9s pour optimiser le processus de construction de l'image ou pour ajouter des fonctionnalit\u00e9s suppl\u00e9mentaires.\n\nVoici quelques exemples d'utilisation des drapeaux dans Dockerfile :\n\n1. Drapeau --no-cache : Ce drapeau est utilis\u00e9 avec la commande RUN pour emp\u00eacher Docker de mettre en cache les r\u00e9sultats de la commande. Cela peut \u00eatre utile lorsque vous voulez vous assurer que les d\u00e9pendances sont toujours t\u00e9l\u00e9charg\u00e9es \u00e0 partir de la source, m\u00eame si elles ont d\u00e9j\u00e0 \u00e9t\u00e9 t\u00e9l\u00e9charg\u00e9es lors d'une construction pr\u00e9c\u00e9dente.\n\nExemple :\n```\nRUN --no-cache apt-get update &amp;&amp; apt-get install -y nginx\n```\n\n2. Drapeau --chown : Ce drapeau est utilis\u00e9 avec la commande COPY ou ADD pour changer le propri\u00e9taire des fichiers copi\u00e9s dans l'image. Cela peut \u00eatre utile lorsque vous voulez vous assurer que les fichiers ont les bonnes permissions dans le conteneur.\n\nExemple :\n```\nCOPY --chown=www-data:www-data index.html \/var\/www\/html\/\n```\n\n3. Drapeau --mount : Ce drapeau est utilis\u00e9 avec la commande RUN pour monter un volume ou un bind mount dans le conteneur pendant la construction de l'image. Cela peut \u00eatre utile lorsque vous voulez acc\u00e9der \u00e0 des fichiers ou des r\u00e9pertoires sur l'h\u00f4te pendant la construction.\n\nExemple :\n```\nRUN --mount=type=bind,source=\/path\/on\/host,target=\/path\/in\/container command\n```\n\n4. Drapeau --platform : Ce drapeau est utilis\u00e9 avec la commande FROM pour sp\u00e9cifier la plateforme cible de l'image. Cela peut \u00eatre utile lorsque vous voulez construire une image multi-architecture.\n\nExemple :\n```\nFROM --platform=linux\/amd64 alpine:latest\n```\n\n5. Drapeau --squash : Ce drapeau est utilis\u00e9 avec la commande docker build pour fusionner toutes les couches de l'image en une seule couche. Cela peut \u00eatre utile pour r\u00e9duire la taille de l'image finale.\n\nExemple :\n```\ndocker build --squash -t myimage .\n```\n\nIl est important de noter que tous les drapeaux ne sont pas disponibles dans toutes les versions de Docker. Certains drapeaux peuvent n\u00e9cessiter une version sp\u00e9cifique de Docker ou de l'API Docker. Il est donc recommand\u00e9 de consulter la documentation de Docker pour conna\u00eetre les drapeaux disponibles et leur utilisation.\n\nEn conclusion, les drapeaux dans Dockerfile sont un moyen puissant d'optimiser et de personnaliser le processus de construction de l'image. Ils permettent aux d\u00e9veloppeurs d'avoir un contr\u00f4le plus fin sur la fa\u00e7on dont l'image est construite et configur\u00e9e. En comprenant et en utilisant correctement les drapeaux, vous pouvez cr\u00e9er des images Docker plus efficaces et adapt\u00e9es \u00e0 vos besoins sp\u00e9cifiques.<\/h1>\n<p>Docker has transformed the way developers build, package, and distribute applications. One of the most critical aspects of utilizing Docker effectively lies in understanding how to build images that can <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> across diverse environments. The <code>--plateforme<\/code> L'option `--platform` est un outil puissant qui facilite les constructions multi-plateformes, permettant aux d\u00e9veloppeurs de sp\u00e9cifier l'architecture cible et le syst\u00e8me d'exploitation pour leurs images Docker. Dans cet article, nous allons explorer en d\u00e9tail le sujet. <code>--plateforme<\/code> drapeau, en explorant ses utilisations, implications et meilleures pratiques, tout en fournissant des informations pour am\u00e9liorer vos strat\u00e9gies de construction Docker.<\/p>\n<h2>What is the <code>--plateforme<\/code> Flag?<\/h2>\n<p>The <code>--plateforme<\/code> flag 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> permet aux d\u00e9veloppeurs de sp\u00e9cifier la plateforme cible pour le <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> being built. This includes defining the operating system and the CPU architecture, such as <code>linux\/amd64<\/code>, <code>linux\/arm64<\/code>, or <code>windows\/amd64<\/code>. By leveraging this flag, developers can create multi-architecture images that can <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> on different hardware and operating system combinations, broadening the reach and compatibility of their applications. The versatility of the <code>--plateforme<\/code> flag enables better support for various deployment environments, including cloud services, diverse server architectures, and local development setups.<\/p>\n<h2>Motivation pour les compilations multiplateforme<\/h2>\n<p>With the growing diversity in computing environments, applications must often <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> on multiple architectures. Here are some motivations for utilizing the <code>--plateforme<\/code> drapeau dans vos processus Docker :<\/p>\n<ol>\n<li>\n<p><strong>Environnements de d\u00e9ploiement vari\u00e9s<\/strong>: Organizations often deploy applications across a mix of hardware architectures and operating systems. By building images for various platforms, developers can ensure their applications <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> consistently, regardless of the underlying infrastructure.<\/p>\n<\/li>\n<li>\n<p><strong>Optimized Performance<\/strong>: Different CPU architectures may offer unique performance characteristics. By targeting specific architectures, developers can leverage those strengths, optimizing performance for their applications.<\/p>\n<\/li>\n<li>\n<p><strong>Emerging Architectures<\/strong>: The rise of ARM-based processors, especially in cloud environments and edge devices, has prompted a need for images compatible with these architectures. The <code>--plateforme<\/code> Le drapeau fournit un m\u00e9canisme simple pour r\u00e9pondre \u00e0 cette demande.<\/p>\n<\/li>\n<li>\n<p><strong>Enhanced CI\/CD Pipelines<\/strong>: In Continuous Integration and Continuous Deployment (CI\/CD) scenarios, it is often beneficial to build images for multiple platforms concurrently. The <code>--plateforme<\/code> flag simplifies this process, allowing for streamlined operations across different environments.<\/p>\n<\/li>\n<\/ol>\n<h2>Comment utiliser le <code>--plateforme<\/code> drapeau<\/h2>\n<p>The <code>--plateforme<\/code> flag can be used in both the <code>docker build<\/code> command and within 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>. Here\u2019s how you can leverage it effectively:<\/p>\n<h3>Sp\u00e9cification de la plateforme dans la commande de construction Docker<\/h3>\n<p>Quand vous <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> the <code>docker build<\/code> command, you can specify the target platform using the <code>--plateforme<\/code> flag. The syntax is as follows:<\/p>\n<pre><code class=\"language-sh\">docker build --platform  -t : <\/code><\/pre>\n<p>For example, to build 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> for the ARM architecture, you would <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>:<\/p>\n<pre><code class=\"language-sh\">docker build --platform linux\/arm64 -t myapp:latest .<\/code><\/pre>\n<h3>Specifying Platform in a Dockerfile<\/h3>\n<p>Dans un <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>, you can also specify the platform using the <code>FROM<\/code> instruction. This is especially useful when working with multi-stage builds or when you want to define platform-specific dependencies. For example:<\/p>\n<pre><code class=\"language-Dockerfile\">FROM --platform=linux\/arm64 alpine:latest\n\n<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> apk <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> curl --no-cache (curl sans cache)<\/code><\/pre>\n<p>This instructs Docker to pull the Alpine <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> specifically for the ARM architecture.<\/p>\n<h2>Images multi-architecture et Buildx<\/h2>\n<p>Docker\u2019s Buildx is a powerful tool that extends the functionality of Docker\u2019s build command, enabling the creation of multi-architecture images seamlessly. To utilize Buildx with the <code>--plateforme<\/code> flag, you first need to ensure that Buildx is installed and set up in your Docker environment.<\/p>\n<h3>Installing and Setting Up Buildx<\/h3>\n<p>Buildx is included with <span class=\"glossaryai-tooltip glossary-term-706\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-desktop\/\" target=\"_blank\">Docker Desktop<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Desktop is a comprehensive development environment for building, testing, and deploying containerized applications. It integrates Docker Engine, Docker CLI, and Kubernetes, enhancing workflow efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-desktop\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> installations, but for Linux users, you may need to install it manually or enable it. To check whether Buildx is available, <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>:<\/p>\n<pre><code class=\"language-sh\"><span class=\"glossaryai-tooltip glossary-term-704\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-buildx\/\" target=\"_blank\">docker buildx<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Buildx permet aux utilisateurs de construire des images en utilisant des fonctionnalit\u00e9s avanc\u00e9es telles que le support multi-plateforme et la mise en cache. Il am\u00e9liore le processus de construction Docker, permettant une cr\u00e9ation d'images efficace et \u00e9volutive dans diff\u00e9rents environnements.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-buildx\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> version<\/code><\/pre>\n<p>Si Buildx n'est pas install\u00e9, vous pouvez suivre les <a href=\"https:\/\/docs.docker.com\/buildx\/working-with-buildx\/\">guide d'installation officiel<\/a> to get started.<\/p>\n<h3>Creating a Multi-Architecture Image<\/h3>\n<p>Une fois que Buildx est configur\u00e9, vous pouvez cr\u00e9er des images multi-architecture en sp\u00e9cifiant plusieurs plateformes dans une seule commande de build. Voici un exemple :<\/p>\n<pre><code class=\"language-sh\"><span class=\"glossaryai-tooltip glossary-term-704\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-buildx\/\" target=\"_blank\">docker buildx<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Buildx permet aux utilisateurs de construire des images en utilisant des fonctionnalit\u00e9s avanc\u00e9es telles que le support multi-plateforme et la mise en cache. Il am\u00e9liore le processus de construction Docker, permettant une cr\u00e9ation d'images efficace et \u00e9volutive dans diff\u00e9rents environnements.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-buildx\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> build --platform linux\/amd64,linux\/arm64 -t myapp:latest --push .<\/code><\/pre>\n<p>In this command, the <code>--push<\/code> L'option automatique pousse les images construites vers le sp\u00e9cifi\u00e9 <span class=\"glossaryai-tooltip glossary-term-658\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\" target=\"_blank\">registry<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un registre est une base de donn\u00e9es centralis\u00e9e qui stocke des informations sur diff\u00e9rentes entit\u00e9s, telles que des installations logicielles, des configurations syst\u00e8me ou des donn\u00e9es utilisateur. Il constitue un composant essentiel pour la gestion et la configuration du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, making it available for other users or environments. This is particularly useful in CI\/CD setups, where you want to ensure that all required architectures are built and available.<\/p>\n<h3>Inspection d'images multi-architecture\n\nLorsque vous utilisez des images multi-architecture, vous pouvez inspecter les images disponibles en utilisant la commande `docker manifest`. Par exemple, pour inspecter l'image `ubuntu`, vous pouvez ex\u00e9cuter la commande suivante :\n\n```bash\ndocker manifest inspect ubuntu\n```\n\nCette commande affichera les d\u00e9tails de l'image `ubuntu`, y compris les diff\u00e9rentes architectures prises en charge.<\/h3>\n<p>To inspect a multi-architecture <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>manifeste docker<\/code> command. This command provides a way to view the different architectures included in your <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>:<\/p>\n<pre><code class=\"language-sh\">docker manifest inspect myapp:latest<\/code><\/pre>\n<p>The output will display the various architectures and tags associated with 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>, allowing you to verify that your multi-architecture strategy is implemented correctly.<\/p>\n<h2>D\u00e9fis et consid\u00e9rations<\/h2>\n<p>Bien que le <code>--plateforme<\/code> Bien que le drapeau offre de nombreux avantages, les d\u00e9veloppeurs doivent \u00eatre conscients des d\u00e9fis et consid\u00e9rations potentiels :<\/p>\n<ol>\n<li>\n<p><strong>Compatibilit\u00e9 des d\u00e9pendances<\/strong>: Not all libraries or binaries are available for every architecture. When building images for multiple platforms, ensure that all dependencies are compatible with the specified architectures to avoid runtime errors.<\/p>\n<\/li>\n<li>\n<p><strong>Variabilit\u00e9 des performances<\/strong>: Applications may behave differently across architectures, leading to performance discrepancies. It\u2019s essential to conduct thorough testing on each supported platform to identify any potential issues.<\/p>\n<\/li>\n<li>\n<p><strong><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> Size<\/strong>: Multi-architecture images can become significantly larger, as they may contain binaries and libraries for multiple architectures. Consider using build strategies that reduce <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> size, such as using <code>--squash<\/code> or optimizing <span class=\"glossaryai-tooltip glossary-term-739\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image-layers\/\" target=\"_blank\">couches d'image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Les calques sont des composants fondamentaux dans les logiciels de conception et d'\u00e9dition graphique, permettant une manipulation non destructive des \u00e9l\u00e9ments. Chaque calque peut contenir diff\u00e9rentes images, effets ou r\u00e9glages, offrant un contr\u00f4le pr\u00e9cis sur la composition et les effets visuels.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image-layers\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<li>\n<p><strong>Build Time<\/strong>: Building images for multiple platforms can increase the build time. It\u2019s important to strike a balance between supporting various architectures and maintaining efficient build times, especially in CI\/CD environments.<\/p>\n<\/li>\n<\/ol>\n<h2>Best Practices for Using the <code>--plateforme<\/code> drapeau<\/h2>\n<p>To maximize the benefits of the <code>--plateforme<\/code> flag while minimizing potential pitfalls, consider the following best practices:<\/p>\n<ol>\n<li>\n<p><strong>Use Buildx for Multi-Architecture Builds<\/strong>: Leverage Buildx to easily create and manage multi-architecture images. This simplifies the process and enhances the efficiency of your build pipelines.<\/p>\n<\/li>\n<li>\n<p><strong>Tester sur diff\u00e9rentes architectures<\/strong>: Implement automated testing for each architecture to ensure that your application behaves consistently. Utilize CI\/CD tools that can build and test images for various platforms.<\/p>\n<\/li>\n<li>\n<p><strong>Optimize Your <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><\/strong>: Use multi-stage builds and minimize the number of layers in your <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>. This helps in creating smaller images and reducing build time.<\/p>\n<\/li>\n<li>\n<p><strong>D\u00e9pendant de la plateforme, il peut y avoir des d\u00e9pendances suppl\u00e9mentaires \u00e0 installer.<\/strong>: Maintain clear documentation of any platform-specific dependencies or configurations required by your application. This helps your team understand the intricacies of multi-platform support.<\/p>\n<\/li>\n<li>\n<p><strong>Use <span class=\"glossaryai-tooltip glossary-term-658\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\" target=\"_blank\">Registre<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un registre est une base de donn\u00e9es centralis\u00e9e qui stocke des informations sur diff\u00e9rentes entit\u00e9s, telles que des installations logicielles, des configurations syst\u00e8me ou des donn\u00e9es utilisateur. Il constitue un composant essentiel pour la gestion et la configuration du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Features<\/strong>Si vous utilisez un... <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-658\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\" target=\"_blank\">registry<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un registre est une base de donn\u00e9es centralis\u00e9e qui stocke des informations sur diff\u00e9rentes entit\u00e9s, telles que des installations logicielles, des configurations syst\u00e8me ou des donn\u00e9es utilisateur. Il constitue un composant essentiel pour la gestion et la configuration du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that supports multi-architecture images (like <span class=\"glossaryai-tooltip glossary-term-653\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\" target=\"_blank\">Docker Hub<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Hub is a cloud-based repository for storing and sharing container images. It facilitates version control, collaborative development, and seamless integration with Docker CLI for efficient container management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or Google <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-658\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\" target=\"_blank\">Registre<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un registre est une base de donn\u00e9es centralis\u00e9e qui stocke des informations sur diff\u00e9rentes entit\u00e9s, telles que des installations logicielles, des configurations syst\u00e8me ou des donn\u00e9es utilisateur. Il constitue un composant essentiel pour la gestion et la configuration du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/registry\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>), make sure to take advantage of its capabilities to manage your images effectively.<\/p>\n<\/li>\n<li>\n<p><strong>Restez inform\u00e9s<\/strong>: Keep your Docker installation up-to-date to take advantage of improvements and new features related to multi-platform support and the <code>--plateforme<\/code> drapeau.<\/p>\n<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>The <code>--plateforme<\/code> drapeau dans <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> is a game-changer for developers looking to build applications that can <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> on various architectures and operating systems. By understanding how to utilize this feature effectively, developers can create versatile, high-performance applications that cater to a diverse range of deployment environments. <\/p>\n<p>Alors que le paysage informatique continue d'\u00e9voluer, en adoptant la prise en charge multi-architecture \u00e0 travers <code>--plateforme<\/code> Le drapeau deviendra de plus en plus vital. Avec les bons outils, les bonnes pratiques et une compr\u00e9hension des principes sous-jacents, vous pouvez exploiter tout le potentiel de Docker pour construire des applications qui sont non seulement robustes, mais aussi adaptables aux besoins d'un environnement informatique moderne et h\u00e9t\u00e9rog\u00e8ne.<\/p>\n<p>Gr\u00e2ce \u00e0 une mise en \u0153uvre r\u00e9fl\u00e9chie et \u00e0 des tests continus, vous pouvez vous assurer que vos applications restent performantes et fiables, quelle que soit l'architecture sous-jacente. Au fur et \u00e0 mesure que vous explorez les capacit\u00e9s de Docker, n'oubliez pas que le chemin vers la ma\u00eetrise de la conteneurisation est continu, et que le <code>--plateforme<\/code> Le drapeau est un acteur cl\u00e9 sur cette voie.<\/p>","protected":false},"excerpt":{"rendered":"<p>Le drapeau `\u2013platform` dans <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> allows developers to specify the target architecture and OS for <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> builds. This feature enhances cross-platform compatibility, enabling consistent deployments across diverse environments.<\/p>","protected":false},"author":1,"featured_media":2017,"parent":0,"template":"","glossary-cat":[],"class_list":["post-1352","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>Dockerfile -platform - 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\/wiki\/plateforme-du-dockerfile\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dockerfile -platform - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"The `--platform` flag in Dockerfile allows developers to specify the target architecture and OS for image builds. This feature enhances cross-platform compatibility, enabling consistent deployments across diverse environments.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/wiki\/plateforme-du-dockerfile\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.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=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/\",\"name\":\"Dockerfile -platform - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg\",\"datePublished\":\"2024-07-23T12:37:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg\",\"width\":800,\"height\":600,\"caption\":\"dockerfile-platform-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#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\":\"Dockerfile &#8211;platform\"}]},{\"@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\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dockerfile -plateforme - 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\/wiki\/plateforme-du-dockerfile\/","og_locale":"fr_FR","og_type":"article","og_title":"Dockerfile -platform - Dockerpros","og_description":"The `--platform` flag in Dockerfile allows developers to specify the target architecture and OS for image builds. This feature enhances cross-platform compatibility, enabling consistent deployments across diverse environments.","og_url":"https:\/\/dockerpros.com\/fr\/wiki\/plateforme-du-dockerfile\/","og_site_name":"Dockerpros","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/","url":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/","name":"Dockerfile -plateforme - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg","datePublished":"2024-07-23T12:37:40+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-platform_1352.jpg","width":800,"height":600,"caption":"dockerfile-platform-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-platform\/#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":"Dockerfile &#8211;platform"}]},{"@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\/"}}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1352\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/2017"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=1352"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary-cat?post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}