{"id":159,"date":"2024-07-21T11:56:56","date_gmt":"2024-07-21T11:56:56","guid":{"rendered":"https:\/\/dockerpros.com\/?p=159"},"modified":"2024-07-21T11:56:56","modified_gmt":"2024-07-21T11:56:56","slug":"what-is-a-dockerfile","status":"publish","type":"post","link":"https:\/\/dockerpros.com\/fr\/introduction-to-docker\/what-is-a-dockerfile\/","title":{"rendered":"What is a Dockerfile?"},"content":{"rendered":"<h1>What is a Dockerfile?<\/h1>\n<p>In today\u2019s fast-paced software development landscape, developers constantly strive for efficiency, scalability, and ease of deployment. One of the most powerful tools that have emerged to facilitate these goals is Docker. At the heart of Docker&#8217;s functionality lies 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>, a crucial component that allows developers to automate the process of creating Docker images. In this article, we will explore what 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> is, its structure, commands, and best practices, as well as real-world applications and how it integrates into the broader Docker ecosystem.<\/p>\n<h2>Understanding Docker and Docker Images<\/h2>\n<p>Before diving into Dockerfiles, it\u2019s essential to grasp the broader context of Docker itself. Docker is an open-source platform that enables developers to automate the deployment of applications inside lightweight, portable containers. Containers encapsulate an application and its dependencies, ensuring that it can <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> consistently across various environments, from a developer&#8217;s local machine to production servers.<\/p>\n<p>Docker images are read-only templates used to create containers. These images contain everything that an application needs to <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>, including the code, libraries, environment variables, and configuration files. 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> serves as the blueprint for creating these images.<\/p>\n<h2>What is a Dockerfile?<\/h2>\n<p>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> is a text file that contains a series of instructions and commands, which Docker uses to automate the creation of Docker images. Each instruction 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> corresponds to a layer in the final <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, allowing for a modular and efficient approach to building images. By defining the environment, application dependencies, and configurations in a <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, developers can ensure that their applications are packaged in a consistent manner.<\/p>\n<h3>Key Features of Dockerfiles<\/h3>\n<ol>\n<li>\n<p><strong>Declarative Syntax<\/strong>: Dockerfiles use a declarative syntax, allowing developers to specify the required environment without needing to write complex scripts.<\/p>\n<\/li>\n<li>\n<p><strong>Layered Architecture<\/strong>: Each command in a <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> creates a new layer in the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This layered structure enables caching, where unchanged layers can be reused, significantly speeding up the build process.<\/p>\n<\/li>\n<li>\n<p><strong>Portability<\/strong>: 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> can be shared and version-controlled just like any other code artifact, making it easy for teams to collaborate and maintain applications.<\/p>\n<\/li>\n<li>\n<p><strong>Automation<\/strong>: By utilizing 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>, developers can automate the building of images, reducing manual errors and streamlining continuous integration\/continuous deployment (CI\/CD) pipelines.<\/p>\n<\/li>\n<\/ol>\n<h2>Structure of a Dockerfile<\/h2>\n<p>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> is comprised of a series of commands, each defining a specific action to be performed in the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> creation process. Here\u2019s a breakdown of the core components and syntax used in a <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<h3>Basic Syntax<\/h3>\n<p>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> consists of commands, which typically include:<\/p>\n<ul>\n<li>\n<p><strong>FROM<\/strong>: Specifies the base <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to use for subsequent instructions. This is the starting point for building a new <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<li>\n<p><strong><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><\/strong>: Executes a command in a new layer and commits the results. This command is often used to install packages or dependencies.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">COPY<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Copies files\/directories from the host machine into the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">ADD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The ADD instruction in Docker is a command used in Dockerfiles to copy files and directories from a host machine into a Docker image during the build process. It not only facilitates the transfer of local files but also provides additional functionality, such as automatically extracting compressed files and fetching remote files via HTTP or HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Similar to <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">COPY<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, but also supports remote URLs and unzipping compressed files.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Provides defaults for executing the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> when it is <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>. There can be only one <span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> instruction per <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>, and if multiple <span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> instructions are provided, only the last one will take effect.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-669\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\" target=\"_blank\">ENTRYPOINT<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An entrypoint serves as the initial point of execution for an application or script. It defines where the program begins its process flow, ensuring proper initialization and resource management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Configures a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that will <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> as an executable. Unlike <span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, <span class=\"glossaryai-tooltip glossary-term-669\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\" target=\"_blank\">ENTRYPOINT<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An entrypoint serves as the initial point of execution for an application or script. It defines where the program begins its process flow, ensuring proper initialization and resource management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> allows you to specify a command and parameters that will always be executed.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-671\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\" target=\"_blank\">ENV<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">ENV, or Environmental Variables, are crucial in software development and system configuration. They store dynamic values that affect the execution environment, enabling flexible application behavior across different platforms.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/env\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Sets environment variables that can be accessed by the application running inside the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-676\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/expose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>: Informs Docker that the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> listens on the specified <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> ports at runtime. This command does not 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\">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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>; it is merely informational.<\/p>\n<\/li>\n<\/ul>\n<h3>Example of a Simple Dockerfile<\/h3>\n<p>To illustrate the structure and usage of 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>, let\u2019s consider a simple example that builds a Python application:<\/p>\n<pre><code class=\"language-Dockerfile\"># Use the official Python base image\nFROM python:3.9-slim\n\n# Set the working directory\nWORKDIR \/app\n\n# Copy the requirements file\nCOPY requirements.txt .\n\n# Install the dependencies\nRUN pip install --no-cache-dir -r requirements.txt\n\n# Copy the application code\nCOPY . .\n\n# Expose the application port\nEXPOSE 5000\n\n# Define the command to run the application\nCMD [\"python\", \"app.py\"]<\/code><\/pre>\n<p>In this example:<\/p>\n<ol>\n<li>The base <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is <code>python:3.9-slim<\/code>, a minimal version of Python.<\/li>\n<li>The working directory is set to <code>\/app<\/code>.<\/li>\n<li>The requirements file is copied, and dependencies are installed.<\/li>\n<li>The entire application code is copied into the <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/li>\n<li>The application exposes <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\">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.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/port\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> 5000 for external access.<\/li>\n<li>Finally, the command to <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the application is specified.<\/li>\n<\/ol>\n<h2>Common Dockerfile Instructions<\/h2>\n<h3>FROM<\/h3>\n<p>The <code>FROM<\/code> instruction is mandatory in a <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, as it defines the base <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> upon which subsequent layers will be built. A common practice is to use official images from <span class=\"glossaryai-tooltip glossary-term-653\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\" target=\"_blank\">Docker Hub<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Hub is a cloud-based repository for storing and sharing container images. It facilitates version control, collaborative development, and seamless integration with Docker CLI for efficient container management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, which provide a wide range of pre-built environments.<\/p>\n<h3>RUN<\/h3>\n<p>The <code><span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">RUN<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command is one of the most frequently used directives. It allows you to execute commands during the build process. You can use it to install software packages, update the system, or perform any actions necessary to prepare the application environment. For example:<\/p>\n<pre><code class=\"language-Dockerfile\"><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> apt-get update &amp;&amp; apt-get install -y curl<\/code><\/pre>\n<h3>COPY vs. ADD<\/h3>\n<p>While both <code><span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">COPY<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> and <code><span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">ADD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The ADD instruction in Docker is a command used in Dockerfiles to copy files and directories from a host machine into a Docker image during the build process. It not only facilitates the transfer of local files but also provides additional functionality, such as automatically extracting compressed files and fetching remote files via HTTP or HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> serve similar purposes, they have distinct differences. The <code><span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">COPY<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command is preferred for copying files from the host to the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, as it is more explicit. The <code><span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">ADD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The ADD instruction in Docker is a command used in Dockerfiles to copy files and directories from a host machine into a Docker image during the build process. It not only facilitates the transfer of local files but also provides additional functionality, such as automatically extracting compressed files and fetching remote files via HTTP or HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command should be used when you need to extract compressed files or fetch files from remote URLs.<\/p>\n<h3>CMD vs. ENTRYPOINT<\/h3>\n<p>The <code><span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> instruction defines the default command to <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> when a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> starts. However, if a command is provided during the <code>docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> command, that will override <code><span class=\"glossaryai-tooltip glossary-term-670\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\" target=\"_blank\">CMD<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">CMD, or Command Prompt, is a command-line interpreter in Windows operating systems. It allows users to execute commands, automate tasks, and manage system files through a text-based interface.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/cmd\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code>. In contrast, <code><span class=\"glossaryai-tooltip glossary-term-669\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\" target=\"_blank\">ENTRYPOINT<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An entrypoint serves as the initial point of execution for an application or script. It defines where the program begins its process flow, ensuring proper initialization and resource management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/entrypoint\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> is used to specify a command that is always executed when the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> runs. You can combine both commands for more flexibility:<\/p>\n<pre><code class=\"language-Dockerfile\">ENTRYPOINT [\"python\"]\nCMD [\"app.py\"]<\/code><\/pre>\n<p>In this example, the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will always execute <code>python<\/code>, but you can override <code>app.py<\/code> with a different script when launching the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/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\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h2>Best Practices for Writing Dockerfiles<\/h2>\n<p>To make the most of Dockerfiles, adhering to best practices is essential. Here are some key recommendations:<\/p>\n<h3>1. Keep it Simple<\/h3>\n<p>Aim for simplicity by minimizing the number of layers and keeping each layer focused on a single <span class=\"glossaryai-tooltip glossary-term-683\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/task\/\" target=\"_blank\">task<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A task is a specific piece of work or duty assigned to an individual or system. It encompasses defined objectives, required resources, and expected outcomes, facilitating structured progress in various contexts.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/task\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This not only results in smaller images but also improves build times.<\/p>\n<h3>2. Use Official Images<\/h3>\n<p>Whenever possible, use official base images provided by <span class=\"glossaryai-tooltip glossary-term-653\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\" target=\"_blank\">Docker Hub<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Hub is a cloud-based repository for storing and sharing container images. It facilitates version control, collaborative development, and seamless integration with Docker CLI for efficient container management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-hub\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. These images are regularly maintained and optimized for performance and security.<\/p>\n<h3>3. Leverage Caching<\/h3>\n<p>Docker caches layers to improve build speed. To take advantage of this, order your <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> commands from the least to most frequently changed. For instance, <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">copy<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the requirements file and install dependencies before copying the application code.<\/p>\n<h3>4. Reduce Image Size<\/h3>\n<p>To minimize the size of the final <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">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\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, consider the following strategies:<\/p>\n<ul>\n<li>Use multi-stage builds to <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">copy<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">COPY is a command in computer programming and data management that facilitates the duplication of files or data from one location to another, ensuring data integrity and accessibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> only necessary artifacts from one stage to another.<\/li>\n<li>Clean up package manager caches after installations, e.g., using <code>apt-get clean<\/code>.<\/li>\n<\/ul>\n<h3>5. Specify Versions<\/h3>\n<p>Specify versions for packages and base images to ensure that your builds are reproducible. Avoid using <code>latest<\/code>, as it can lead to unpredictable builds.<\/p>\n<h3>6. Document Your Dockerfile<\/h3>\n<p>Adding comments to your <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> helps other developers understand the reasoning behind specific commands and configurations. This is especially important in collaborative environments.<\/p>\n<h2>Real-World Applications of Dockerfiles<\/h2>\n<p>Dockerfiles are widely used across various domains and industries. Here are a few notable applications:<\/p>\n<h3>Continuous Integration\/Continuous Deployment (CI\/CD)<\/h3>\n<p>In modern DevOps practices, Dockerfiles play an integral role in CI\/CD pipelines. They automate the image-building process, enabling teams to quickly deploy consistent environments across development, testing, and production.<\/p>\n<h3>Microservices Architecture<\/h3>\n<p>Dockerfiles facilitate the development and deployment of microservices by allowing teams to define individual <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\">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\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> environments. Each microservice can have its own <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>, promoting modularity and scalability.<\/p>\n<h3>Cloud-Native Applications<\/h3>\n<p>With the rise of cloud-native applications, Dockerfiles have become essential in creating portable images that can be deployed across various cloud provider platforms, such as AWS, Google Cloud, and Azure.<\/p>\n<h2>Conclusion<\/h2>\n<p>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> is a fundamental building block in the world of containerization, providing a structured way to automate the creation of Docker images. By mastering Dockerfiles, developers can ensure that their applications are portable, efficient, and easy to deploy across various environments.<\/p>\n<p>As organizations continue to adopt Docker and containerization as essential components of their software delivery processes, understanding and effectively utilizing Dockerfiles will be critical for development and operations teams alike. By adhering to best practices and leveraging the capabilities of Dockerfiles, teams can unlock the full potential of containerization, leading to improved collaboration, faster deployments, and ultimately, more resilient applications.<\/p>","protected":false},"excerpt":{"rendered":"<p>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> is a text file that contains instructions for building Docker images. It defines the environment, dependencies, and configuration needed to create a containerized application.<\/p>","protected":false},"author":1,"featured_media":418,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-introduction-to-docker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is a Dockerfile? - 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\/introduction-a-docker\/what-is-a-dockerfile\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is a Dockerfile? - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"A Dockerfile is a text file that contains instructions for building Docker images. It defines the environment, dependencies, and configuration needed to create a containerized application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-dockerfile\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-21T11:56:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"dockerpros\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"dockerpros\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/\"},\"author\":{\"name\":\"dockerpros\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\"},\"headline\":\"What is a Dockerfile?\",\"datePublished\":\"2024-07-21T11:56:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/\"},\"wordCount\":1298,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg\",\"articleSection\":[\"Introduction to Docker\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/\",\"url\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/\",\"name\":\"What is a Dockerfile? - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg\",\"datePublished\":\"2024-07-21T11:56:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg\",\"width\":800,\"height\":600,\"caption\":\"what-is-a-dockerfile-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is a Dockerfile?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\",\"name\":\"dockerpros\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1779972442\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1779972442\",\"caption\":\"dockerpros\"},\"sameAs\":[\"https:\/\/dockerpros.com\/\"],\"url\":\"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Qu'est-ce qu'un Dockerfile ? - 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\/introduction-a-docker\/what-is-a-dockerfile\/","og_locale":"fr_FR","og_type":"article","og_title":"What is a Dockerfile? - Dockerpros","og_description":"A Dockerfile is a text file that contains instructions for building Docker images. It defines the environment, dependencies, and configuration needed to create a containerized application.","og_url":"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-dockerfile\/","og_site_name":"Dockerpros","article_published_time":"2024-07-21T11:56:56+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg","type":"image\/jpeg"}],"author":"dockerpros","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"dockerpros","Dur\u00e9e de lecture estim\u00e9e":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#article","isPartOf":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/"},"author":{"name":"dockerpros","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4"},"headline":"What is a Dockerfile?","datePublished":"2024-07-21T11:56:56+00:00","mainEntityOfPage":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/"},"wordCount":1298,"commentCount":0,"publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"image":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg","articleSection":["Introduction to Docker"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/","url":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/","name":"Qu'est-ce qu'un Dockerfile ? - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg","datePublished":"2024-07-21T11:56:56+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-dockerfile_159.jpg","width":800,"height":600,"caption":"what-is-a-dockerfile-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/es\/introduccion-a-docker\/un-dockerfile-es-un-archivo-de-texto-que-contiene-una-serie-de-instrucciones-para-construir-una-imagen-de-docker-es-como-una-receta-que-le-dice-a-docker-como-crear-una-imagen-personalizada-para-tu-ap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"What is a Dockerfile?"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Dockerpros","description":"DockerPros \u2013 Votre centre de ressources Docker incontournable","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Dockerpros","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4","name":"professionnels Docker","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1779972442","contentUrl":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1779972442","caption":"dockerpros"},"sameAs":["https:\/\/dockerpros.com\/"],"url":"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/"}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/418"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}