{"id":167,"date":"2024-07-21T11:56:38","date_gmt":"2024-07-21T11:56:38","guid":{"rendered":"https:\/\/dockerpros.com\/?p=167"},"modified":"2024-07-21T11:56:38","modified_gmt":"2024-07-21T11:56:38","slug":"what-is-a-read-only-container-in-docker","status":"publish","type":"post","link":"https:\/\/dockerpros.com\/fr\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/","title":{"rendered":"What is a read-only container in Docker?"},"content":{"rendered":"<h1>Qu'est-ce qu'un conteneur en lecture seule dans Docker ?\n\nUn conteneur en lecture seule dans Docker est un conteneur dont le syst\u00e8me de fichiers est mont\u00e9 en lecture seule, ce qui signifie que les processus \u00e0 l'int\u00e9rieur du conteneur ne peuvent pas modifier les fichiers du syst\u00e8me de fichiers du conteneur. Cela offre une couche de s\u00e9curit\u00e9 suppl\u00e9mentaire en emp\u00eachant les modifications accidentelles ou malveillantes du syst\u00e8me de fichiers du conteneur.\n\nPour cr\u00e9er un conteneur en lecture seule dans Docker, vous pouvez utiliser l'option --read-only lors de l'ex\u00e9cution de la commande docker run. Par exemple :\n\n```\ndocker run --read-only -d nginx\n```\n\nDans cet exemple, le conteneur nginx est cr\u00e9\u00e9 en mode lecture seule. Les processus \u00e0 l'int\u00e9rieur du conteneur ne peuvent pas modifier les fichiers du syst\u00e8me de fichiers du conteneur, mais ils peuvent toujours lire les fichiers.\n\nIl est important de noter que m\u00eame si le syst\u00e8me de fichiers du conteneur est en lecture seule, les processus \u00e0 l'int\u00e9rieur du conteneur peuvent toujours \u00e9crire dans les volumes mont\u00e9s et les r\u00e9pertoires temporaires. Si vous souhaitez emp\u00eacher compl\u00e8tement les processus d'\u00e9crire des donn\u00e9es, vous devez \u00e9galement utiliser l'option --tmpfs pour monter un syst\u00e8me de fichiers temporaire en m\u00e9moire, et vous assurer que tous les volumes n\u00e9cessaires sont mont\u00e9s en lecture seule.\n\nLes conteneurs en lecture seule sont particuli\u00e8rement utiles dans les environnements de production o\u00f9 la s\u00e9curit\u00e9 et la stabilit\u00e9 sont primordiales. Ils peuvent aider \u00e0 pr\u00e9venir les modifications non autoris\u00e9es du syst\u00e8me de fichiers du conteneur et \u00e0 garantir que le conteneur fonctionne de mani\u00e8re coh\u00e9rente et pr\u00e9visible.<\/h1>\n<p>Docker a r\u00e9volutionn\u00e9 la mani\u00e8re dont nous d\u00e9veloppons, livrons et <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> applications. One of the fundamental concepts within Docker is the ability to create containers that are isolated environments for running applications. Among the various features Docker provides, the concept of a read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is particularly compelling for its security and operational advantages. In this article, we will explore what a read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is, its use cases, how to create one, and the implications of using such containers in real-world scenarios.<\/p>\n<h2>Understanding Docker Containers<\/h2>\n<p>Before diving into read-only containers, it\u2019s essential to grasp the basics of Docker containers. A Docker <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a lightweight, standalone, executable package that includes everything needed 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> a piece of software, including the code, libraries, and runtime. Containers are built from images, which are essentially blueprints for creating containers.<\/p>\n<p>L'un des principaux avantages de l'utilisation des conteneurs Docker est leur capacit\u00e9 \u00e0 encapsuler les applications et leurs d\u00e9pendances. Cette encapsulation garantit que l'application s'ex\u00e9cute de mani\u00e8re uniforme dans diff\u00e9rents environnements, que ce soit sur l'ordinateur portable d'un d\u00e9veloppeur, un serveur de test ou un environnement de production.<\/p>\n<h2>Qu'est-ce qu'un conteneur en lecture seule ?<\/h2>\n<p>A read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, as the name suggests, is a Docker <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> whose filesystem is set to read-only mode. This means that processes running inside the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> cannot modify the filesystem. This feature can be particularly useful in scenarios where you want to ensure that the application\u2019s state remains unchanged throughout its execution.<\/p>\n<h3>Caract\u00e9ristiques cl\u00e9s des conteneurs en lecture seule<\/h3>\n<ol>\n<li>\n<p><strong>Immutable Filesystem<\/strong>: In a read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, once the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is started, its filesystem cannot be altered. Any attempt to write to the filesystem will result in an error. This is particularly useful for preventing accidental changes that might compromise the integrity of the application.<\/p>\n<\/li>\n<li>\n<p><strong>Am\u00e9lioration de la s\u00e9curit\u00e9<\/strong>: \u00c9tant donn\u00e9 que le syst\u00e8me de fichiers est immuable, les conteneurs en lecture seule peuvent fournir une couche de s\u00e9curit\u00e9 suppl\u00e9mentaire. Les attaques malveillantes qui tentent de modifier des fichiers ou d'introduire des vuln\u00e9rabilit\u00e9s ne peuvent pas r\u00e9ussir puisque le syst\u00e8me de fichiers est verrouill\u00e9.<\/p>\n<\/li>\n<li>\n<p><strong>Consistency<\/strong>: En emp\u00eachant toute op\u00e9ration d'\u00e9criture, les conteneurs en lecture seule garantissent que l'application se comporte de mani\u00e8re coh\u00e9rente lors de diff\u00e9rentes ex\u00e9cutions. Cela peut \u00eatre inestimable lors des tests ou lors du d\u00e9ploiement d'applications en production.<\/p>\n<\/li>\n<\/ol>\n<h2>Cas d'utilisation pour les conteneurs en lecture seule<\/h2>\n<h3>1. Architecture de microservices<\/h3>\n<p>In microservices architectures, applications are broken down into smaller, independent services. Deploying these services in read-only containers can enhance security and reliability. For instance, a microservice that serves as a static web page generator does not need to modify files on the filesystem; thus, it is a prime candidate for a read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h3>2. CI\/CD Pipelines<\/h3>\n<p>Continuous Integration and Continuous Deployment (CI\/CD) pipelines often involve multiple stages, including build, test, and deployment. Using read-only containers in these pipelines can help ensure that the environment remains consistent and that tests are <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> in a controlled setting, free from unwanted changes.<\/p>\n<h3>3. Applications statiques<\/h3>\n<p>Applications that are inherently static, such as static website generators or applications that rely on read-only data, can greatly benefit from the read-only filesystem. By leveraging read-only containers, developers can ensure the integrity of the application without the risk of unintentional modifications.<\/p>\n<h3>4. Testing<\/h3>\n<p>When running tests, especially automated tests, it is crucial to ensure that the test environment is free from external influences. By employing read-only containers, developers can guarantee a clean and consistent environment for every test <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h2>Creating a Read-Only Container<\/h2>\n<p>Creating a read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Docker is a straightforward process. Docker\u2019s command-line interface allows you to specify the read-only option easily. Here\u2019s a step-by-step guide:<\/p>\n<h3>\u00c9tape 1 : Cr\u00e9er une image Docker<\/h3>\n<p>Tout d'abord, vous devez cr\u00e9er un Docker. <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. Voici une simple <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> exemple :<\/p>\n<pre><code class=\"language-Dockerfile\">FROM nginx:alpine\n\n<span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">COPIE<\/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> . \/usr\/share\/nginx\/html<\/code><\/pre>\n<p>This <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> sets up a simple Nginx web server and copies your website files into the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/p>\n<h3>Step 2: Build the Docker Image<\/h3>\n<p>Next, build the Docker <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> using the following command:<\/p>\n<pre><code class=\"language-bash\">docker build -t my-nginx-image .<\/code><\/pre>\n<h3>\u00c9tape 3 : Ex\u00e9cuter le conteneur en lecture seule<\/h3>\n<p>Pour <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 <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in read-only mode, use the <code>--read-only<\/code> drapeau:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> --read-only -d my-nginx-image<\/code><\/pre>\n<p>With this command, the Nginx <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will start, but it will not allow any write operations to its filesystem.<\/p>\n<h3>\u00c9tape 4 : V\u00e9rifier le mode lecture seule<\/h3>\n<p>You can verify that the filesystem is indeed read-only by executing a command inside the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker exec -it  sh<\/code><\/pre>\n<p>Ensuite, essayez de cr\u00e9er un fichier :<\/p>\n<pre><code class=\"language-sh\">touch \/usr\/share\/nginx\/html\/testfile<\/code><\/pre>\n<p>You should receive a permission denied error, confirming that the filesystem is read-only.<\/p>\n<h2>Limitations of Read-Only Containers<\/h2>\n<p>Bien que les conteneurs en lecture seule offrent plusieurs avantages, ils pr\u00e9sentent \u00e9galement des limites que les d\u00e9veloppeurs doivent conna\u00eetre :<\/p>\n<h3>1. Auxiliary Storage<\/h3>\n<p>\u00c9tant donn\u00e9 que le syst\u00e8me de fichiers est en lecture seule, toute application n\u00e9cessitant l'\u00e9criture de donn\u00e9es dans le syst\u00e8me de fichiers ne fonctionnera pas correctement par d\u00e9faut. Pour surmonter cette limitation, vous pouvez utiliser des volumes Docker ou des montages de liaison pour fournir un stockage accessible en \u00e9criture. Par exemple, si votre application doit \u00e9crire des journaux, vous pouvez monter un <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to a specific directory within the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that allows writing.<\/p>\n<h3>2. Donn\u00e9es temporaires<\/h3>\n<p>If your application generates temporary data, you will need to handle this data appropriately. Since the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> itself cannot write to its filesystem, you must devise external mechanisms for logging or storing temporary files.<\/p>\n<h3>3. Complexit\u00e9 de la configuration<\/h3>\n<p>Bien que les avantages soient \u00e9vidents, l'introduction de conteneurs en lecture seule peut <span class=\"glossaryai-tooltip glossary-term-674\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\" target=\"_blank\">add<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">La commande ADD dans Docker est une instruction utilis\u00e9e dans les Dockerfiles pour copier des fichiers et des r\u00e9pertoires depuis une machine h\u00f4te vers une image Docker pendant le processus de construction. Elle facilite non seulement le transfert de fichiers locaux, mais offre \u00e9galement des fonctionnalit\u00e9s suppl\u00e9mentaires, telles que l'extraction automatique de fichiers compress\u00e9s et le t\u00e9l\u00e9chargement de fichiers distants via HTTP ou HTTPS.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/add\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> complexit\u00e9 \u00e0 vos processus de configuration et de d\u00e9ploiement. Il est essentiel de s'assurer que toutes les parties de votre application sont compatibles avec le paradigme en lecture seule.<\/p>\n<h2>Best Practices for Using Read-Only Containers<\/h2>\n<h3>1. Identify Read-Only Use Cases<\/h3>\n<p>Toutes les applications ne conviennent pas \u00e0 une ex\u00e9cution en lecture seule. Identifiez les composants de votre application <span class=\"glossaryai-tooltip glossary-term-682\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/stack\/\" target=\"_blank\">pile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une pile est une structure de donn\u00e9es qui fonctionne selon le principe du dernier entr\u00e9, premier sorti (LIFO), o\u00f9 l'\u00e9l\u00e9ment le plus r\u00e9cemment ajout\u00e9 est le premier \u00e0 \u00eatre retir\u00e9. Elle prend en charge deux op\u00e9rations principales : empiler et d\u00e9piler.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/stack\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> qui peut fonctionner en mode lecture seule de mani\u00e8re efficace.<\/p>\n<h3>2. Utilisez les volumes Docker avec prudence.<\/h3>\n<p>Utilisez des volumes Docker ou des montages de liaison pour toutes les op\u00e9rations de syst\u00e8me de fichiers requises par votre application. Assurez-vous que ces volumes sont correctement configur\u00e9s pour maintenir l'int\u00e9grit\u00e9 et la s\u00e9curit\u00e9 de votre application.<\/p>\n<h3>3. Surveiller et auditer<\/h3>\n<p>Surveillez r\u00e9guli\u00e8rement vos conteneurs en lecture seule pour vous assurer qu'ils fonctionnent comme pr\u00e9vu. Mettez en \u0153uvre des m\u00e9canismes de journalisation qui puissent offrir une visibilit\u00e9 sans n\u00e9cessiter d'\u00e9critures dans le syst\u00e8me de fichiers.<\/p>\n<h3>4. Automatiser le cycle de vie des conteneurs<\/h3>\n<p>Int\u00e9grez des outils d'automatisation pour g\u00e9rer le cycle de vie de vos conteneurs en lecture seule. Des outils comme <span class=\"glossaryai-tooltip glossary-term-656\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\" target=\"_blank\">Kubernetes<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications, enhancing resource efficiency and resilience.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/kubernetes\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> can help orchestrate <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management effectively.<\/p>\n<h3>5. Document Configuration<\/h3>\n<p>Documentez les configurations et contraintes associ\u00e9es aux conteneurs en lecture seule. Cette documentation servira de r\u00e9f\u00e9rence pr\u00e9cieuse pour les autres d\u00e9veloppeurs et les \u00e9quipes d'exploitation.<\/p>\n<h2>Conclusion<\/h2>\n<p>Les conteneurs en lecture seule dans Docker offrent un ensemble de fonctionnalit\u00e9s pr\u00e9cieux pour renforcer la s\u00e9curit\u00e9, la coh\u00e9rence et la fiabilit\u00e9 du d\u00e9ploiement des applications. En interdisant toute op\u00e9ration d'\u00e9criture sur le syst\u00e8me de fichiers, ces conteneurs constituent une solution robuste pour divers cas d'usage, des microservices aux pipelines CI\/CD.<\/p>\n<p>Bien qu'il existe des limitations et des consid\u00e9rations \u00e0 garder \u00e0 l'esprit, les avantages de l'utilisation de conteneurs en lecture seule l'emportent largement sur les inconv\u00e9nients dans les sc\u00e9narios o\u00f9 l'int\u00e9grit\u00e9 de l'application est primordiale. \u00c0 mesure que les organisations continuent d'adopter la conteneurisation et les m\u00e9thodologies DevOps, la compr\u00e9hension et la mise en \u0153uvre de conteneurs en lecture seule deviendront de plus en plus importantes pour cr\u00e9er des architectures d'applications s\u00e9curis\u00e9es et fiables. <\/p>\n<p>Avec une planification et une ex\u00e9cution soign\u00e9es, la puissance des conteneurs de type read-only peut \u00eatre utilis\u00e9e pour construire des applications robustes qui s'alignent sur les pratiques modernes de d\u00e9veloppement.<\/p>","protected":false},"excerpt":{"rendered":"<p>A read-only <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in Docker is a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> that restricts write access to its filesystem. This enhances security and stability, making it ideal for running unchangeable applications.<\/p>","protected":false},"author":1,"featured_media":402,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-167","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 read-only container in Docker? - Dockerpros<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-read-only-container-in-docker\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is a read-only container in Docker? - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"A read-only container in Docker is a container that restricts write access to its filesystem. This enhances security and stability, making it ideal for running unchangeable applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-read-only-container-in-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-21T11:56:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/\"},\"author\":{\"name\":\"dockerpros\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\"},\"headline\":\"What is a read-only container in Docker?\",\"datePublished\":\"2024-07-21T11:56:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/\"},\"wordCount\":1125,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg\",\"articleSection\":[\"Introduction to Docker\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/\",\"url\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/\",\"name\":\"What is a read-only container in Docker? - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg\",\"datePublished\":\"2024-07-21T11:56:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg\",\"width\":800,\"height\":600,\"caption\":\"what-is-a-read-only-container-in-docker-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is a read-only container in Docker?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\",\"name\":\"dockerpros\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"caption\":\"dockerpros\"},\"sameAs\":[\"https:\/\/dockerpros.com\/\"],\"url\":\"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is a read-only container in Docker? - Dockerpros","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-read-only-container-in-docker\/","og_locale":"fr_FR","og_type":"article","og_title":"What is a read-only container in Docker? - Dockerpros","og_description":"A read-only container in Docker is a container that restricts write access to its filesystem. This enhances security and stability, making it ideal for running unchangeable applications.","og_url":"https:\/\/dockerpros.com\/fr\/introduction-a-docker\/what-is-a-read-only-container-in-docker\/","og_site_name":"Dockerpros","article_published_time":"2024-07-21T11:56:38+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg","type":"image\/jpeg"}],"author":"dockerpros","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"dockerpros","Dur\u00e9e de lecture estim\u00e9e":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#article","isPartOf":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/"},"author":{"name":"dockerpros","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4"},"headline":"What is a read-only container in Docker?","datePublished":"2024-07-21T11:56:38+00:00","mainEntityOfPage":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/"},"wordCount":1125,"commentCount":0,"publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"image":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg","articleSection":["Introduction to Docker"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/","url":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/","name":"What is a read-only container in Docker? - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg","datePublished":"2024-07-21T11:56:38+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/what-is-a-read-only-container-in-docker_167.jpg","width":800,"height":600,"caption":"what-is-a-read-only-container-in-docker-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/introduction-to-docker\/what-is-a-read-only-container-in-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"What is a read-only container in Docker?"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Dockerpros","description":"DockerPros \u2013 Votre centre de ressources Docker incontournable","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Dockerpros","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4","name":"professionnels Docker","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","contentUrl":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","caption":"dockerpros"},"sameAs":["https:\/\/dockerpros.com\/"],"url":"https:\/\/dockerpros.com\/fr\/author\/dockerpros\/"}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/167","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=167"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/402"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}