{"id":676,"date":"2024-07-22T20:37:50","date_gmt":"2024-07-22T20:37:50","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=676"},"modified":"2024-07-22T20:54:59","modified_gmt":"2024-07-22T20:54:59","slug":"expose","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/fr\/wiki\/expose\/","title":{"rendered":"EXPOSE"},"content":{"rendered":"<h1>Understanding Docker EXPOSE: A Deep Dive into Container Networking<\/h1>\n<h2>Introduction to EXPOSE<\/h2>\n<p>In the realm of Docker, the <code>EXPOSE<\/code> instruction plays a pivotal role in defining how containers communicate within 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>. Cette commande, trouv\u00e9e 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>, specifies which ports the <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> listens on at runtime, serving as a form of documentation between the <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> and the external world. While <code>EXPOSE<\/code> ne publie pas r\u00e9ellement les ports, il agit comme une indication pour les utilisateurs et <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> outils concernant les ports destin\u00e9s \u00e0 la communication. Comprendre les nuances des <code>EXPOSE<\/code> instruction is crucial for developers and systems administrators who aim to optimize their containerized applications for performance, security, and scalability.<\/p>\n<h2>La Syntaxe de EXPOSE<\/h2>\n<p>The <code>EXPOSE<\/code> instruction can be specified in two ways 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>:<\/p>\n<ol>\n<li>\n<p><strong>Single <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">Port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Format<\/strong>: You can specify a single <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> comme \u00e7a<\/p>\n<pre><code class=\"language-dockerfile\">EXPOSE 8080<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>Multiple Ports<\/strong>: You can also expose multiple ports by listing them sequentially:<\/p>\n<pre><code class=\"language-dockerfile\">EXPOSE 8080 443<\/code><\/pre>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">Port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> with Protocol<\/strong>: Docker also allows you to specify the protocol (TCP or UDP) alongside the <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> number:<\/p>\n<pre><code class=\"language-dockerfile\">EXPOSE 8080\/tcp\nEXPOSE 53\/udp<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>While the default protocol is TCP, explicitly stating the protocol can enhance clarity and avoid potential conflicts during <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>.<\/p>\n<h2>Pourquoi utiliser EXPOSE ?<\/h2>\n<h3>Documentation and Clarity<\/h3>\n<p>Le but principal de l' <code>EXPOSE<\/code> instruction is to serve as documentation. When a developer reviews 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>, the <code>EXPOSE<\/code> Les directives illustrent clairement les ports destin\u00e9s \u00e0 la communication externe. Cela permet aux membres de l'\u00e9quipe de comprendre les points d'interaction de l'application conteneuris\u00e9e sans avoir \u00e0 explorer en profondeur le code de l'application ou les fichiers de configuration.<\/p>\n<h3>Networking Best Practices<\/h3>\n<p>En utilisant <code>EXPOSE<\/code> effectively helps maintain networking best practices. By explicitly defining which ports are used, it prevents potential conflicts and security issues arising from unintentional <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> exposure. It serves as a guideline for those who manage or deploy the <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>, helping ensure that the container\u2019s architecture adheres to principles of least privilege.<\/p>\n<h3>Compatibility with Docker Compose and Orchestration Tools<\/h3>\n<p>Lorsque vous travaillez avec <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> or other <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>, <code>EXPOSE<\/code> instructions can aid in defining services and networking configurations. They provide automatic <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> mapping and allow for easier <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. While <code>EXPOSE<\/code> alone does not publish the ports, it informs the infrastructure on how to handle networking.<\/p>\n<h2>Comment EXPOSE fonctionne avec d'autres commandes Docker\n\nL'instruction EXPOSE dans un Dockerfile indique les ports sur lesquels le conteneur \u00e9coute pour les connexions. Cependant, EXPOSE ne rend pas les ports accessibles \u00e0 l'h\u00f4te. Pour ce faire, vous devez utiliser l'option -p ou -P lors de l'ex\u00e9cution du conteneur.\n\nL'option -p vous permet de mapper un port sp\u00e9cifique du conteneur \u00e0 un port de l'h\u00f4te. Par exemple, si votre conteneur \u00e9coute sur le port 80 et que vous voulez y acc\u00e9der sur le port 8080 de l'h\u00f4te, vous pouvez utiliser la commande suivante :\n\ndocker run -p 8080:80 mon_image\n\nL'option -P, quant \u00e0 elle, mappe tous les ports EXPOSE du conteneur \u00e0 des ports al\u00e9atoires de l'h\u00f4te. Docker choisit automatiquement les ports de l'h\u00f4te et les affiche lors du d\u00e9marrage du conteneur.\n\nIl est important de noter que EXPOSE est simplement une documentation pour les utilisateurs du conteneur. Il indique les ports que le conteneur attend pour \u00eatre connect\u00e9. Cependant, pour que les ports soient r\u00e9ellement accessibles, vous devez utiliser les options -p ou -P lors de l'ex\u00e9cution du conteneur.\n\nEn r\u00e9sum\u00e9, EXPOSE est utilis\u00e9 pour documenter les ports attendus par le conteneur, tandis que -p et -P sont utilis\u00e9s pour mapper ces ports \u00e0 l'h\u00f4te et les rendre accessibles.<\/h2>\n<h3>Running Containers with Port Mapping<\/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> a <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> en utilisant le <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> commande, vous pouvez publier les ports en utilisant le\/la <code>-p<\/code> or <code>publier<\/code> option. For example:<\/p>\n<pre><code class=\"language-bash\">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> -d -p 8080:8080 myapp<\/code><\/pre>\n<p>Dans cette commande, <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <code>8080<\/code> from the host is mapped to <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <code>8080<\/code> of the <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>. Le <code>EXPOSE<\/code> instruction complements this by highlighting that <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <code>8080<\/code> is expected to be accessed.<\/p>\n<h3>EXPOSE in the Context of Docker Networks<\/h3>\n<p>Docker allows you to create isolated networks for containers, enhancing communication and security. When using user-defined networks, containers can communicate with each other by their names without needing to expose ports. However, when you want to access a <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> from outside 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>, using <code>EXPOSE<\/code> along with proper <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> mapping becomes essential.<\/p>\n<h3>Interaction avec Docker Compose<\/h3>\n<p>Dans un <code>docker-compose.yml<\/code> file, the <code>ports<\/code> keyword can be used to specify mappings similar to the <code>-p<\/code> option in <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>. Voici comment proc\u00e9der : <code>EXPOSE<\/code> fits into this context:<\/p>\n<pre><code class=\"language-yaml\">version: '3'\nservices:\n  web:\n    build: .\n    ports:\n      - \"8080:8080\"\n    expose:\n      - \"8080\"<\/code><\/pre>\n<p>In this instance, the <code>expose<\/code> key under the <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> defines the same <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> as <code>EXPOSE<\/code> in the <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>, emphasizing the intended communication point for internal services.<\/p>\n<h2>EXPOSE et Consid\u00e9rations de S\u00e9curit\u00e9<\/h2>\n<p>While <code>EXPOSE<\/code> sert de documentation, il ne restreint ni n'impose l'acc\u00e8s aux ports sp\u00e9cifi\u00e9s. Il est donc crucial de combiner <code>EXPOSE<\/code> avec des mesures de s\u00e9curit\u00e9 appropri\u00e9es. Voici quelques points \u00e0 consid\u00e9rer :<\/p>\n<h3>Firewall Rules<\/h3>\n<p>Make sure to configure your firewall rules to limit access to only the necessary ports. Exposing a <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Docker without controlling access can leave your application vulnerable to attacks.<\/p>\n<h3>Isolement du r\u00e9seau<\/h3>\n<p>Utilisez les fonctionnalit\u00e9s de mise en r\u00e9seau de Docker pour isoler les conteneurs. Lorsque vous cr\u00e9ez des r\u00e9seaux d\u00e9finis par l'utilisateur, les conteneurs peuvent communiquer sans avoir besoin d'exposer des ports au monde ext\u00e9rieur. Cette pratique am\u00e9liore la s\u00e9curit\u00e9 en minimisant la surface d'attaque.<\/p>\n<h3>Analyse de s\u00e9curit\u00e9 \u00e0 l'ex\u00e9cution<\/h3>\n<p>Incorporate tools that scan 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> images for vulnerabilities. Some security scanners also review the <code>EXPOSE<\/code> directives to ensure that no unnecessary ports are being exposed.<\/p>\n<h2>The Role of EXPOSE in Microservices Architecture<\/h2>\n<p>Dans une architecture microservices, les conteneurs communiquent souvent via des ports sp\u00e9cifiques. <code>EXPOSE<\/code> in each microservice\u2019s <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> can clarify which ports are intended for inter-service communication. This becomes particularly valuable in larger applications, where multiple services need to interact in a defined manner.<\/p>\n<h3>Service Discovery<\/h3>\n<p>With tools like <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>, <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 can be made easier when ports are clearly defined. <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> utilizes the information provided by <code>EXPOSE<\/code> pour g\u00e9rer comment les services interagissent les uns avec les autres au sein du cluster.<\/p>\n<h3>\u00c9quilibrage de charge<\/h3>\n<p>Lorsque vous utilisez un load balancer, conna\u00eetre les ports expos\u00e9s par vos conteneurs aide \u00e0 configurer correctement ce dernier. Ceci est particuli\u00e8rement important dans les sc\u00e9narios impliquant une haute disponibilit\u00e9 et une redondance, o\u00f9 le trafic doit \u00eatre r\u00e9parti intelligemment.<\/p>\n<h2>Common Pitfalls and Best Practices<\/h2>\n<h3>Assuming EXPOSE Publishes Ports<\/h3>\n<p>L'une des id\u00e9es fausses les plus courantes concernant <code>EXPOSE<\/code> is the assumption that it automatically makes the <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> accessible from outside the <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>. Remember that it is only a documentation tool, and you still need to publish the <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> en utilisant le <code>-p<\/code> option ou des m\u00e9thodes similaires.<\/p>\n<h3>Sure, here is the translation of the text into French:\n\nExposition excessive des ports\n\nL'exposition excessive des ports est un probl\u00e8me de s\u00e9curit\u00e9 courant dans les environnements informatiques. Cela se produit lorsque des ports r\u00e9seau sont ouverts et accessibles de mani\u00e8re inutile, ce qui peut permettre \u00e0 des attaquants d'acc\u00e9der \u00e0 des syst\u00e8mes ou des donn\u00e9es sensibles.\n\nLes ports sont des points d'entr\u00e9e virtuels qui permettent aux applications et aux services de communiquer sur un r\u00e9seau. Chaque port est associ\u00e9 \u00e0 un num\u00e9ro sp\u00e9cifique, et les applications utilisent ces num\u00e9ros pour \u00e9tablir des connexions et \u00e9changer des donn\u00e9es.\n\nLorsque des ports sont expos\u00e9s de mani\u00e8re excessive, cela signifie qu'ils sont ouverts et accessibles \u00e0 partir de l'ext\u00e9rieur du r\u00e9seau, m\u00eame s'ils ne sont pas n\u00e9cessaires pour le fonctionnement normal du syst\u00e8me. Cela peut se produire pour plusieurs raisons, notamment :\n\n1. Configuration incorrecte : Les administrateurs syst\u00e8me peuvent ouvrir des ports par erreur ou ne pas les fermer apr\u00e8s avoir termin\u00e9 une t\u00e2che sp\u00e9cifique.\n\n2. Manque de surveillance : Les organisations peuvent ne pas surveiller r\u00e9guli\u00e8rement les ports ouverts sur leurs syst\u00e8mes, ce qui permet \u00e0 des ports inutiles de rester ouverts pendant de longues p\u00e9riodes.\n\n3. N\u00e9gligence de la s\u00e9curit\u00e9 : Certaines organisations peuvent ne pas accorder suffisamment d'importance \u00e0 la s\u00e9curit\u00e9 des ports, ce qui les expose \u00e0 des risques inutiles.\n\nL'exposition excessive des ports peut avoir de graves cons\u00e9quences pour la s\u00e9curit\u00e9 d'un syst\u00e8me. Les attaquants peuvent utiliser des ports ouverts pour lancer des attaques telles que :\n\n1. Scans de ports : Les attaquants peuvent scanner les ports ouverts pour identifier les services et les applications vuln\u00e9rables.\n\n2. Attaques par d\u00e9ni de service (DDoS) : Les attaquants peuvent utiliser des ports ouverts pour lancer des attaques DDoS, ce qui peut surcharger les syst\u00e8mes et les rendre indisponibles.\n\n3. Acc\u00e8s non autoris\u00e9 : Les attaquants peuvent exploiter des ports ouverts pour acc\u00e9der \u00e0 des syst\u00e8mes ou des donn\u00e9es sensibles sans autorisation.\n\nPour pr\u00e9venir l'exposition excessive des ports, il est important de suivre les meilleures pratiques de s\u00e9curit\u00e9, notamment :\n\n1. R\u00e9aliser des audits de s\u00e9curit\u00e9 r\u00e9guliers pour identifier les ports ouverts inutiles.\n\n2. Fermer les ports qui ne sont pas n\u00e9cessaires pour le fonctionnement normal du syst\u00e8me.\n\n3. Utiliser des pare-feu pour filtrer le trafic entrant et sortant.\n\n4. Mettre en place des politiques de s\u00e9curit\u00e9 strictes pour contr\u00f4ler l'acc\u00e8s aux ports.\n\n5. Former les employ\u00e9s \u00e0 la s\u00e9curit\u00e9 des ports et \u00e0 l'importance de la fermeture des ports inutiles.\n\nEn conclusion, l'exposition excessive des ports est un probl\u00e8me de s\u00e9curit\u00e9 important qui peut exposer les syst\u00e8mes et les donn\u00e9es \u00e0 des risques inutiles. En suivant les meilleures pratiques de s\u00e9curit\u00e9 et en surveillant r\u00e9guli\u00e8rement les ports ouverts, les organisations peuvent r\u00e9duire consid\u00e9rablement les risques associ\u00e9s \u00e0 l'exposition excessive des ports.<\/h3>\n<p>Another pitfall is overexposing ports. Only expose the ports that are necessary for your application to function. This practice helps reduce the attack surface and enhances security.<\/p>\n<h3>Documenter au-del\u00e0 d'EXPOSE<\/h3>\n<p>Bien que <code>EXPOSE<\/code> serves as documentation, consider augmenting your Dockerfiles with comments or additional documentation that explains the purpose of each exposed <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This can be invaluable for teams that may not be familiar with the <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> architecture.<\/p>\n<h2>Conclusion<\/h2>\n<p>The <code>EXPOSE<\/code> L'instruction dans Docker est un concept fondamental qui am\u00e9liore l'utilisabilit\u00e9, la clart\u00e9 et la s\u00e9curit\u00e9 des applications conteneuris\u00e9es. Comprendre son objectif, son utilisation correcte et ses implications est essentiel pour les d\u00e9veloppeurs et les administrateurs syst\u00e8me qui visent \u00e0 construire des solutions conteneuris\u00e9es efficaces. En tirant parti <code>EXPOSE<\/code> En conjonction avec les capacit\u00e9s de mise en r\u00e9seau de Docker et les meilleures pratiques, les \u00e9quipes peuvent cr\u00e9er des applications robustes, \u00e9volutives et s\u00e9curis\u00e9es qui prosp\u00e8rent dans les environnements de d\u00e9veloppement et de production.<\/p>\n<p>Alors que la conteneurisation continue d'\u00e9voluer, ma\u00eetriser les complexit\u00e9s de la mise en r\u00e9seau, y compris la <code>EXPOSE<\/code> instruction, will remain a cornerstone of successful application delivery in the cloud-native ecosystem. Whether you\u2019re deploying simple applications or complex microservices architectures, a solid understanding of <span class=\"glossaryai-tooltip glossary-term-677\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\" target=\"_blank\">port<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un PORT est un point de communication dans un r\u00e9seau informatique, d\u00e9fini par un identifiant num\u00e9rique. Il facilite l'acheminement des donn\u00e9es vers des applications sp\u00e9cifiques, am\u00e9liorant la fonctionnalit\u00e9 et la s\u00e9curit\u00e9 du syst\u00e8me.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> exposure and networking will empower you to make informed decisions that drive 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> strategy forward.<\/p>","protected":false},"excerpt":{"rendered":"<p>\u201cEXPOSE\u201d est un outil puissant utilis\u00e9 dans divers domaines, y compris la cybers\u00e9curit\u00e9 et le d\u00e9veloppement logiciel, pour identifier les vuln\u00e9rabilit\u00e9s et les lacunes des syst\u00e8mes, garantissant ainsi la mise en place de mesures de s\u00e9curit\u00e9 robustes.<\/p>","protected":false},"author":1,"featured_media":1466,"parent":0,"template":"","glossary-cat":[],"class_list":["post-676","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>EXPOSE - 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\/expose\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EXPOSE - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"&quot;EXPOSE&quot; is a powerful tool used in various fields, including cybersecurity and software development, to identify vulnerabilities and shortcomings in systems, ensuring robust security measures are implemented.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/wiki\/expose\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-22T20:54:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/expose\/\",\"name\":\"EXPOSE - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg\",\"datePublished\":\"2024-07-22T20:37:50+00:00\",\"dateModified\":\"2024-07-22T20:54:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/expose\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg\",\"width\":800,\"height\":600,\"caption\":\"expose-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/expose\/#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\":\"EXPOSE\"}]},{\"@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":"EXPOSE - 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\/expose\/","og_locale":"fr_FR","og_type":"article","og_title":"EXPOSE - Dockerpros","og_description":"\"EXPOSE\" is a powerful tool used in various fields, including cybersecurity and software development, to identify vulnerabilities and shortcomings in systems, ensuring robust security measures are implemented.","og_url":"https:\/\/dockerpros.com\/fr\/wiki\/expose\/","og_site_name":"Dockerpros","article_modified_time":"2024-07-22T20:54:59+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/expose\/","url":"https:\/\/dockerpros.com\/wiki\/expose\/","name":"EXPOSE - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg","datePublished":"2024-07-22T20:37:50+00:00","dateModified":"2024-07-22T20:54:59+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/expose\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/expose\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/wiki\/expose\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/expose_676.jpg","width":800,"height":600,"caption":"expose-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/expose\/#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":"EXPOSE"}]},{"@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\/676","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\/676\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/1466"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=676"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary-cat?post=676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}