{"id":677,"date":"2024-07-22T20:37:50","date_gmt":"2024-07-22T20:37:50","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=677"},"modified":"2024-07-22T20:54:59","modified_gmt":"2024-07-22T20:54:59","slug":"port","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/de\/wiki\/port\/","title":{"rendered":"Hafen"},"content":{"rendered":"<h1>Understanding Docker Ports: An In-Depth Exploration<\/h1>\n<p>In the context of Docker, a <strong>port<\/strong> refers to a communication endpoint that allows containers to exchange information with the external environment or with other containers. Ports serve as gateways for data traffic, enabling developers to <span class=\"glossaryai-tooltip glossary-term-676\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\" target=\"_blank\">expose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> specific services running inside containers to the outside world or to manage inter-container communication effectively. This article will delve into the intricacies of Docker ports, their configuration, common practices, and the best strategies to ensure optimal performance and security.<\/p>\n<h2>The Role of Ports in Networking<\/h2>\n<p>To understand how Docker handles ports, it is essential to comprehend the underlying principles of networking. In computer networking, a port is a numerical identifier in the range of 0 to 65535, which is a component of the TCP\/IP networking model. Each port can be assigned to a specific <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or application to listen for incoming traffic, facilitating communication over the <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<p>In Docker, each <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> operates in an isolated environment with its own <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <span class=\"glossaryai-tooltip glossary-term-682\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/stack\/\" target=\"_blank\">stack<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A stack is a data structure that operates on a Last In, First Out (LIFO) principle, where the most recently added element is the first to be removed. It supports two primary operations: push and pop.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/stack\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. By default, containers are not directly accessible from the host machine or outside the <span class=\"glossaryai-tooltip glossary-term-699\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-network\/\" target=\"_blank\">Docker network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Network enables seamless communication between containers in isolated environments. It supports various drivers, such as bridge and overlay, allowing flexible networking configurations tailored to application needs.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This isolation is a key feature of Docker&#8217;s architecture, allowing multiple containers to operate without interference. However, this necessitates the use of ports to enable communication between the containers and the host.<\/p>\n<h2>Docker Networking Modes<\/h2>\n<p>Before diving deeper into ports, it is vital to understand the various networking modes available in Docker, as this affects how ports are managed:<\/p>\n<ol>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-662\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/bridge-network\/\" target=\"_blank\">Bridge Network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Bridge Network facilitates interoperability between various blockchain ecosystems, enabling seamless asset transfers and communication. Its architecture enhances scalability and user accessibility across networks.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/bridge-network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: This is the default networking mode in Docker. Each <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> gets its own IP address on a private <span class=\"glossaryai-tooltip glossary-term-662\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/bridge-network\/\" target=\"_blank\">bridge network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Bridge Network facilitates interoperability between various blockchain ecosystems, enabling seamless asset transfers and communication. Its architecture enhances scalability and user accessibility across networks.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/bridge-network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, and the host can communicate with the containers using port mapping.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-664\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/host-network\/\" target=\"_blank\">Host Network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A host network refers to the underlying infrastructure that supports communication between devices in a computing environment. It encompasses protocols, hardware, and software facilitating data exchange.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/host-network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: In this mode, the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> shares the host&#8217;s <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <span class=\"glossaryai-tooltip glossary-term-682\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/stack\/\" target=\"_blank\">stack<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A stack is a data structure that operates on a Last In, First Out (LIFO) principle, where the most recently added element is the first to be removed. It supports two primary operations: push and pop.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/stack\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. Ports are directly exposed to the host, eliminating the need for port mapping. This mode can enhance performance but reduces isolation.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-663\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/overlay-network\/\" target=\"_blank\">Overlay Network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An overlay network is a virtual network built on top of an existing physical network. It enables efficient communication and resource sharing, enhancing scalability and flexibility while abstracting underlying infrastructure complexities.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/overlay-network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Designed for multi-host networking, this mode allows containers across different hosts to communicate. Overlay networks are typically used in orchestrated environments like <span class=\"glossaryai-tooltip glossary-term-655\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-swarm\/\" target=\"_blank\">Docker Swarm<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Swarm is a container orchestration tool that enables the management of a cluster of Docker engines. It simplifies scaling and deployment, ensuring high availability and load balancing across services.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-swarm\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<li>\n<p><strong>Macvlan <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">Network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: This mode allows containers to be assigned their own MAC addresses, making them appear as physical devices on the <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This is particularly useful for legacy applications that require direct access to the <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<\/ol>\n<h2>Exposing Ports in Docker<\/h2>\n<h3>Exposing Ports in Dockerfile<\/h3>\n<p>When building a Docker <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you can specify which ports the application will listen on using the <code><span class=\"glossaryai-tooltip glossary-term-676\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\" target=\"_blank\">EXPOSE<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> instruction in the <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This does not publish the port; rather, it serves as documentation for users of the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. It also allows Docker to understand which ports need to be published when running the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<pre><code class=\"language-dockerfile\">FROM nginx\n<span class=\"glossaryai-tooltip glossary-term-676\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\" target=\"_blank\">EXPOSE<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> 80<\/code><\/pre>\n<p>In this example, the <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> indicates that the Nginx server inside the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will listen on port 80.<\/p>\n<h3>Publishing Ports with Docker Run<\/h3>\n<p>To make a container&#8217;s port accessible from the host, you can publish ports using the <code>-p<\/code> or <code>--publish<\/code> flag with the <code>docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command. The syntax for this is:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -p [host_port]:[container_port] [image_name]<\/code><\/pre>\n<p>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\/de\/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\/de\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -d -p 8080:80 nginx<\/code><\/pre>\n<p>In this command, port 80 of the Nginx <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is mapped to port 8080 on the host. This means that accessing <code>http:\/\/localhost:8080<\/code> will route traffic to the Nginx server running inside the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h3>Multiple Port Mappings<\/h3>\n<p>You can publish multiple ports while running a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> by specifying multiple <code>-p<\/code> flags:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -d -p 8080:80 -p 443:443 nginx<\/code><\/pre>\n<p>In this example, both HTTP (port 80) and HTTPS (port 443) ports of the Nginx <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> are mapped to the host.<\/p>\n<h3>Automatic Port Assignment<\/h3>\n<p>Docker also allows you to map a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> port to a random port on the host by specifying only the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> port:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\/de\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -d -p 80 nginx<\/code><\/pre>\n<p>Here, Docker will automatically assign a random port on the host to port 80 of the Nginx <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. You can check which port was assigned by inspecting the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or using <code>docker ps<\/code>.<\/p>\n<h2>Docker Compose and Ports<\/h2>\n<p>For multi-container applications, <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose 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\/de\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> offers a streamlined way to define services, networks, and volumes in a single <span class=\"glossaryai-tooltip glossary-term-690\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/yaml\/\" target=\"_blank\">YAML<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">YAML (YAML Ain't Markup Language) is a human-readable data serialization format commonly used for configuration files. It emphasizes simplicity and clarity, making it suitable for both developers and non-developers.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/yaml\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> file. In a <code>docker-compose.yml<\/code> file, you can specify port mappings under the <code>ports<\/code> section for each <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<pre><code class=\"language-yaml\">version: '3'\nservices:\n  web:\n    image: nginx\n    ports:\n      - \"8080:80\"\n  db:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: mysql\n    environment:\n      MYSQL_ROOT_PASSWORD: example<\/code><\/pre>\n<p>In this example, the Nginx web server <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will map port 80 to port 8080 on the host, while the MySQL <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> runs internally without exposing its port.<\/p>\n<h2>Best Practices for Managing Ports in Docker<\/h2>\n<h3>Use Descriptive Port Numbers<\/h3>\n<p>When defining ports, especially in a multi-service application, use descriptive port numbers that indicate the service&#8217;s purpose. For instance, use port 8080 for HTTP traffic and 8443 for HTTPS, rather than arbitrary numbers like 5000 or 6000.<\/p>\n<h3>Limit Exposed Ports<\/h3>\n<p>Only <span class=\"glossaryai-tooltip glossary-term-676\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\" target=\"_blank\">expose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/expose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the necessary ports for your application. Reducing the number of open ports diminishes the attack surface and enhances security. For example, if your application doesn\u2019t require external access to its database, avoid exposing its port.<\/p>\n<h3>Utilize Firewall Rules<\/h3>\n<p>Implement firewall rules on the host machine to restrict access to specific ports. This adds an additional layer of security, ensuring that only trusted sources can access your services.<\/p>\n<h3>Network Segmentation<\/h3>\n<p>Use Docker networks to segment your applications. For example, if you have a microservices architecture, you might create a separate <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> for each <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to limit communication to only necessary interactions.<\/p>\n<h3>Use Environment Variables<\/h3>\n<p>Instead of hardcoding port numbers, consider configuring them through environment variables. This allows for greater flexibility and enables you to change port assignments without modifying the code.<\/p>\n<pre><code class=\"language-yaml\">version: '3'\nservices:\n  web:\n    image: nginx\n    ports:\n      - \"${WEB_PORT}:80\"<\/code><\/pre>\n<p>In this example, the port can be easily changed by altering the <code>WEB_PORT<\/code> environment variable.<\/p>\n<h2>Troubleshooting Port Issues<\/h2>\n<h3>Checking Port Availability<\/h3>\n<p>Before starting a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, ensure that the specified host port is available and not already in use by another <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. You can use the <code>netstat<\/code> or <code>lsof<\/code> commands to check if the port is occupied.<\/p>\n<pre><code class=\"language-bash\"># Check for ports in use\nnetstat -tuln<\/code><\/pre>\n<h3>Inspecting Running Containers<\/h3>\n<p>If an application isn\u2019t accessible, inspect the running containers to verify the port mappings:<\/p>\n<pre><code class=\"language-bash\">docker ps<\/code><\/pre>\n<p>This command will show you the mapped ports for all running containers.<\/p>\n<h3>Checking Logs<\/h3>\n<p>Logs can provide insights into why a <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Service refers to the act of providing assistance or support to fulfill specific needs or requirements. In various domains, it encompasses customer service, technical support, and professional services, emphasizing efficiency and user satisfaction.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> might not be responding. Use the following command to view the logs of a specific <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker logs [container_id]<\/code><\/pre>\n<h3>Debugging Network Connectivity<\/h3>\n<p>You can enter a running <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to troubleshoot <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/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\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> connectivity using the following command:<\/p>\n<pre><code class=\"language-bash\">docker exec -it [container_id] \/bin\/bash<\/code><\/pre>\n<p>Once inside, you can use tools like <code>curl<\/code> or <code>ping<\/code> to check if other containers or services are reachable.<\/p>\n<h2>Conclusion<\/h2>\n<p>Understanding and managing ports in Docker is crucial for ensuring robust, secure, and efficient containerized applications. By leveraging the various networking modes and careful port management strategies, developers can create highly scalable and isolated environments that facilitate seamless communication.<\/p>\n<p>The correct handling of Docker ports not only enhances security and performance but also plays a significant role in the overall architecture of microservices and distributed applications. By following best practices and employing systematic troubleshooting techniques, developers can navigate the complexities of <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> networking with confidence, paving the way for successful deployments in modern cloud-native environments.<\/p>\n<p>In an era where microservices and <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <span class=\"glossaryai-tooltip glossary-term-657\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/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\">Orchestration refers to the automated management and coordination of complex systems and services. It optimizes processes by integrating various components, ensuring efficient operation and resource utilization.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/orchestration\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> are becoming the norm, mastering the art of Docker ports is an indispensable skill for developers and system administrators alike.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ein PORT ist ein Kommunikationsendpunkt in einem Computer. <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\" target=\"_blank\">network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Ein Netzwerk im Bereich der Informatik bezeichnet eine Sammlung miteinander verbundener Ger\u00e4te, die miteinander kommunizieren und Ressourcen teilen. Es erm\u00f6glicht den Datenaustausch, erleichtert die Zusammenarbeit und verbessert die betriebliche Effizienz.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/de\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, defined by a numerical identifier. It facilitates the routing of data to specific applications, enhancing system functionality and security.<\/p>","protected":false},"author":1,"featured_media":1468,"parent":0,"template":"","glossary-cat":[],"class_list":["post-677","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>PORT - Dockerpros<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dockerpros.com\/de\/wiki\/port\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PORT - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"A PORT is a communication endpoint in a computer network, defined by a numerical identifier. It facilitates the routing of data to specific applications, enhancing system functionality and security.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/de\/wiki\/port\/\" \/>\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\/port_677.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"6\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/port\/\",\"name\":\"PORT - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg\",\"datePublished\":\"2024-07-22T20:37:50+00:00\",\"dateModified\":\"2024-07-22T20:54:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/port\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg\",\"width\":800,\"height\":600,\"caption\":\"port-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/port\/#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\":\"PORT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PORT - Docker-Profis","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dockerpros.com\/de\/wiki\/port\/","og_locale":"de_DE","og_type":"article","og_title":"PORT - Dockerpros","og_description":"A PORT is a communication endpoint in a computer network, defined by a numerical identifier. It facilitates the routing of data to specific applications, enhancing system functionality and security.","og_url":"https:\/\/dockerpros.com\/de\/wiki\/port\/","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\/port_677.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"6\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/port\/","url":"https:\/\/dockerpros.com\/wiki\/port\/","name":"PORT - Docker-Profis","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg","datePublished":"2024-07-22T20:37:50+00:00","dateModified":"2024-07-22T20:54:59+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/port\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/port\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/dockerpros.com\/wiki\/port\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/port_677.jpg","width":800,"height":600,"caption":"port-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/port\/#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":"PORT"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Docker-Profis","description":"DockerPros \u2013 Ihr umfassender Docker-Ressourcen-Hub","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Docker-Profis","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary\/677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary\/677\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/media\/1468"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/media?parent=677"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/de\/wp-json\/wp\/v2\/glossary-cat?post=677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}