{"id":1403,"date":"2024-07-23T12:39:30","date_gmt":"2024-07-23T12:39:30","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=1403"},"modified":"2024-07-23T12:39:30","modified_gmt":"2024-07-23T12:39:30","slug":"dockerfile-cache-thresholds","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-cache-thresholds\/","title":{"rendered":"Dockerfile \u2013seuils de cache"},"content":{"rendered":"<h1>Understanding Dockerfile \u2013cache-thresholds: An Advanced Guide<\/h1>\n<p>Dans le domaine de la conteneurisation et des microservices, Docker s'est impos\u00e9 comme un outil essentiel qui simplifie le processus de d\u00e9veloppement, de d\u00e9ploiement et de scalabilit\u00e9 des applications. L'une des fonctionnalit\u00e9s les moins discut\u00e9es mais hautement impactantes de Docker est la <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> <code>--cache-thresholds<\/code> option. Cette fonctionnalit\u00e9 permet aux d\u00e9veloppeurs d'exercer un contr\u00f4le plus pr\u00e9cis sur le m\u00e9canisme de cache pendant le <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> en d\u00e9finissant des seuils de r\u00e9utilisation du cache, ce qui optimise les temps de construction et l'utilisation des ressources. Comprendre cette fonctionnalit\u00e9 peut am\u00e9liorer consid\u00e9rablement l'efficacit\u00e9 des flux de travail, en particulier dans les projets complexes comportant des processus de construction \u00e9tendus.<\/p>\n<h2>The Role of Caching in Docker Builds<\/h2>\n<p>Before delving into <code>--cache-thresholds<\/code>, it&#8217;s essential to grasp the concept of caching in Docker. Caching is a mechanism that allows Docker to save time and resources by reusing previously built layers of an <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>. When 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 executed, Docker creates an <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> layer for each command specified 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>. These layers are cached, allowing Docker to skip the execution of these commands if it detects no changes in the underlying files or commands.<\/p>\n<p>La mise en cache acc\u00e9l\u00e8re le processus de construction, r\u00e9duit la consommation de ressources et peut consid\u00e9rablement am\u00e9liorer les flux de travail d'int\u00e9gration et de livraison continues. Cependant, il existe des sc\u00e9narios o\u00f9 le comportement de mise en cache par d\u00e9faut peut ne pas correspondre aux besoins du d\u00e9veloppeur, en particulier lors de modifications fr\u00e9quentes ou d'optimisation pour diff\u00e9rents environnements. C'est l\u00e0 que <code>--cache-thresholds<\/code> becomes relevant.<\/p>\n<h2>Qu'est-ce que <code>--cache-thresholds<\/code>?<\/h2>\n<p>The <code>--cache-thresholds<\/code> Cette option a \u00e9t\u00e9 introduite dans Docker 19.03 dans le cadre des am\u00e9liorations de BuildKit. Elle permet aux d\u00e9veloppeurs de d\u00e9finir des seuils de r\u00e9utilisation du cache, influen\u00e7ant ainsi la d\u00e9cision de Docker d'utiliser les couches mises en cache ou de les reconstruire \u00e0 partir de z\u00e9ro. Gr\u00e2ce \u00e0 cette option, Docker peut g\u00e9rer intelligemment le moment d'utiliser ou d'invalider les caches en fonction de crit\u00e8res d\u00e9finis, rendant le processus de construction plus efficace.<\/p>\n<p>La syntaxe pour utiliser <code>--cache-thresholds<\/code> dans une commande Docker build est la suivante :<\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds== ...<\/code><\/pre>\n<p>Here, <code>repr\u00e9sente le param\u00e8tre de cache sp\u00e9cifique que vous souhaitez d\u00e9finir, et<\/code> is the threshold you want to set. Understanding the available keys and their implications is crucial for leveraging this feature effectively.<\/p>\n<h2>Key Parameters for Cache Thresholds<\/h2>\n<p><code>--cache-thresholds<\/code> prend en charge plusieurs param\u00e8tres, chacun affectant diff\u00e9rents aspects du comportement de mise en cache. Les cl\u00e9s les plus couramment utilis\u00e9es incluent :<\/p>\n<h3>1. <code>taille<\/code><\/h3>\n<p>The <code>taille<\/code> La cl\u00e9 permet de d\u00e9finir un seuil de taille maximale pour les entr\u00e9es du cache. Si la taille d'une couche mise en cache d\u00e9passe ce seuil, Docker ne r\u00e9utilisera pas ce cache. Cela peut \u00eatre utile dans des situations o\u00f9 de grandes couches pourraient entra\u00eener des inefficacit\u00e9s ou des temps de construction plus longs. En d\u00e9finissant une limite de taille, les d\u00e9veloppeurs peuvent s'assurer que seules les couches plus petites et plus efficaces sont mises en cache et r\u00e9utilis\u00e9es.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=size=100m .<\/code><\/pre>\n<p>Dans cet exemple, toute couche mise en cache d\u00e9passant 100 m\u00e9gaoctets ne sera pas r\u00e9utilis\u00e9e.<\/p>\n<h3>2. <code>duration<\/code><\/h3>\n<p>The <code>duration<\/code> key sets a time limit on how long a cache entry remains valid. If a cache entry has not been used for longer than the specified duration, it will be invalidated and rebuilt even if no changes were made to the associated <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> commandes.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=duration=1h .<\/code><\/pre>\n<p>This command would invalidate cache entries that have not been accessed in the last hour.<\/p>\n<h3>3. <code>access-time<\/code><\/h3>\n<p>The <code>access-time<\/code> Le param\u00e8tre agit comme <code>duration<\/code>, mais il se concentre sp\u00e9cifiquement sur l'heure du dernier acc\u00e8s \u00e0 l'entr\u00e9e du cache. Si une entr\u00e9e du cache n'a pas \u00e9t\u00e9 acc\u00e9d\u00e9e depuis un seuil de temps sp\u00e9cifi\u00e9, elle sera invalid\u00e9e.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=access-time=30m .<\/code><\/pre>\n<p>Avec ce param\u00e8tre, toute couche mise en cache qui n'a pas \u00e9t\u00e9 consult\u00e9e au cours des 30 derni\u00e8res minutes sera consid\u00e9r\u00e9e comme p\u00e9rim\u00e9e et sera reconstruite.<\/p>\n<h3>4. <code>build-time<\/code><\/h3>\n<p>The <code>build-time<\/code> Le seuil permet aux d\u00e9veloppeurs de d\u00e9finir des limites sur le temps qu'une couche peut prendre pour \u00eatre construite avant d'\u00eatre consid\u00e9r\u00e9e comme obsol\u00e8te. Cela est particuli\u00e8rement utile lors de la gestion de commandes dont les temps d'ex\u00e9cution sont connus pour \u00eatre variables.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=build-time=5m .<\/code><\/pre>\n<p>Dans ce sc\u00e9nario, si une couche prend plus de 5 minutes \u00e0 construire, Docker la reconstruira, que les fichiers sous-jacents aient chang\u00e9 ou non.<\/p>\n<h2>Avantages de l'utilisation <code>--cache-thresholds<\/code><\/h2>\n<p>The introduction of <code>--cache-thresholds<\/code> fundamentally alters the way developers can optimize their Docker builds. Here are some of the key benefits:<\/p>\n<h3>1. Am\u00e9lioration des performances de construction<\/h3>\n<p>By fine-tuning cache usage based on size, duration, and access patterns, developers can significantly improve the performance of their builds. This can lead to faster feedback loops in development and more efficient CI\/CD pipelines.<\/p>\n<h3>2. Optimisation des ressources<\/h3>\n<p>La limitation des tailles de cache et des temps de construction garantit une utilisation plus efficace des ressources. Cela est particuli\u00e8rement important dans les environnements partag\u00e9s ou les syst\u00e8mes CI\/CD o\u00f9 les ressources peuvent \u00eatre limit\u00e9es.<\/p>\n<h3>3. Adaptabilit\u00e9<\/h3>\n<p>\u00c0 mesure que les projets \u00e9voluent, la nature du code et des d\u00e9pendances peut changer. <code>--cache-thresholds<\/code> provides the flexibility to adapt caching strategies to fit these changes, ensuring that the build process remains optimal.<\/p>\n<h3>4. Reduced Build Failures<\/h3>\n<p>En invalidant les caches susceptibles de produire des r\u00e9sultats p\u00e9rim\u00e9s ou incorrects, les d\u00e9veloppeurs peuvent r\u00e9duire la fr\u00e9quence des \u00e9checs de construction li\u00e9s aux changements de d\u00e9pendances ou aux couches obsol\u00e8tes.<\/p>\n<h2>Cas d'usage pratiques<\/h2>\n<p>Understanding the potential applications of <code>--cache-thresholds<\/code> can help developers make informed decisions about when and how to implement this feature.<\/p>\n<h3>Use Case 1: Microservices with Frequent Changes<\/h3>\n<p>In a microservices architecture where services are frequently updated, using a cache duration of, say, one hour can ensure that layers are rebuilt regularly. This prevents stale dependencies from being used, ensuring that developers always get the most up-to-date build.<\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=duration=1h .<\/code><\/pre>\n<h3>Use Case 2: Large Data Processing Jobs<\/h3>\n<p>For jobs that deal with large datasets, setting a size threshold can prevent Docker from caching overly large layers. This can help maintain manageable <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> sizes and lead to faster deployment times.<\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=size=50m .<\/code><\/pre>\n<h3>Use Case 3: Enhancing CI\/CD Pipelines<\/h3>\n<p>In CI\/CD environments, build times can escalate rapidly if not managed properly. Employers can set strict thresholds for build times to ensure that builds do not exceed a certain duration, thus maintaining pipeline efficiency.<\/p>\n<pre><code class=\"language-bash\">docker build --cache-thresholds=build-time=2m .<\/code><\/pre>\n<h2>Meilleures pratiques pour l'utilisation <code>--cache-thresholds<\/code><\/h2>\n<p>While <code>--cache-thresholds<\/code> offers various advantages, it is essential to adopt best practices to maximize its benefits.<\/p>\n<h3>1. Analyze Build Results<\/h3>\n<p>Avant de mettre en place des seuils de cache, analysez les r\u00e9sultats de build pour identifier les couches qui prennent le plus de temps ou qui consomment le plus de ressources. Ces donn\u00e9es permettront d'\u00e9clairer les d\u00e9cisions concernant les seuils \u00e0 d\u00e9finir.<\/p>\n<h3>2. Testez de mani\u00e8re incr\u00e9mentale<\/h3>\n<p>Commencez avec des seuils conservateurs et ajustez-les progressivement en fonction des performances de build observ\u00e9es. Cette approche it\u00e9rative vous permet d'\u00e9valuer l'impact des modifications sans risquer l'instabilit\u00e9 du build.<\/p>\n<h3>3. Collaborate with Teams<\/h3>\n<p>When working in teams, ensure that all members understand the implications of cache thresholds. Having a cohesive strategy for managing caching can prevent misunderstandings and enhance overall workflow.<\/p>\n<h3>4. Surveiller r\u00e9guli\u00e8rement<\/h3>\n<p>Surveillez en permanence les temps de construction, l'utilisation des ressources et les taux de r\u00e9ussite du cache. Cette analyse continue permet d'ajuster les seuils de cache et de r\u00e9agir aux changements dans le projet ou l'environnement.<\/p>\n<h3>5. Documentez vos choix<\/h3>\n<p>Make sure to document the rationale behind the chosen thresholds. This documentation can serve as a reference for future team members and help maintain consistency in build strategies.<\/p>\n<h2>Conclusion<\/h2>\n<p>The <code>--cache-thresholds<\/code> feature in <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> represents a significant advancement in managing caching strategies during <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> builds. By allowing developers to set specific parameters around cache usage, this feature empowers them to optimize their build processes, enhance performance, and better utilize resources. As containerization continues to drive modern application development, understanding and implementing advanced features like <code>--cache-thresholds<\/code> peut offrir un avantage concurrentiel. <\/p>\n<p>In an increasingly complex development landscape, where microservices and rapid deployment cycles are the norm, mastering caching behavior through the strategic use of <code>--cache-thresholds<\/code> n'est pas seulement avantageux, c'est essentiel. Gr\u00e2ce \u00e0 une analyse minutieuse, des changements incr\u00e9mentaux et une approche collaborative, les d\u00e9veloppeurs peuvent tirer parti de cette fonctionnalit\u00e9 pour rationaliser leurs flux de travail et livrer efficacement des logiciels de haute qualit\u00e9.<\/p>","protected":false},"excerpt":{"rendered":"<p>The `\u2013cache-thresholds` option in <span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> permet aux utilisateurs de d\u00e9finir des limites pour la mise en cache des r\u00e9sultats interm\u00e9diaires <span class=\"glossaryai-tooltip glossary-term-739\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image-layers\/\" target=\"_blank\">couches d'image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Les calques sont des composants fondamentaux dans les logiciels de conception et d'\u00e9dition graphique, permettant une manipulation non destructive des \u00e9l\u00e9ments. Chaque calque peut contenir diff\u00e9rentes images, effets ou r\u00e9glages, offrant un contr\u00f4le pr\u00e9cis sur la composition et les effets visuels.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image-layers\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. Cette fonctionnalit\u00e9 optimise les temps de construction en \u00e9vitant les reconstructions inutiles, am\u00e9liorant ainsi l'efficacit\u00e9 globale des flux de travail CI\/CD.<\/p>","protected":false},"author":1,"featured_media":2119,"parent":0,"template":"","glossary-cat":[],"class_list":["post-1403","glossary","type-glossary","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Dockerfile -cache-thresholds - Dockerpros<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-cache-thresholds\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dockerfile -cache-thresholds - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"The `--cache-thresholds` option in Dockerfile allows users to define limits for caching intermediate image layers. This feature optimizes build times by preventing unnecessary rebuilds, enhancing overall efficiency in CI\/CD workflows.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-cache-thresholds\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/\",\"name\":\"Dockerfile -cache-thresholds - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg\",\"datePublished\":\"2024-07-23T12:39:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg\",\"width\":800,\"height\":600,\"caption\":\"dockerfile-cache-thresholds-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Glossary\",\"item\":\"https:\/\/dockerpros.com\/fr\/wiki\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Dockerfile &#8211;cache-thresholds\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dockerfile -cache-thresholds - Dockerpros","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-cache-thresholds\/","og_locale":"fr_FR","og_type":"article","og_title":"Dockerfile -cache-thresholds - Dockerpros","og_description":"The `--cache-thresholds` option in Dockerfile allows users to define limits for caching intermediate image layers. This feature optimizes build times by preventing unnecessary rebuilds, enhancing overall efficiency in CI\/CD workflows.","og_url":"https:\/\/dockerpros.com\/fr\/wiki\/dockerfile-cache-thresholds\/","og_site_name":"Dockerpros","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/","url":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/","name":"Dockerfile -cache-thresholds - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg","datePublished":"2024-07-23T12:39:30+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/dockerfile-cache-thresholds_1403.jpg","width":800,"height":600,"caption":"dockerfile-cache-thresholds-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/dockerfile-cache-thresholds\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"Glossary","item":"https:\/\/dockerpros.com\/fr\/wiki\/"},{"@type":"ListItem","position":3,"name":"Dockerfile &#8211;cache-thresholds"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Dockerpros","description":"DockerPros \u2013 Votre centre de ressources Docker incontournable","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Dockerpros","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1403\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/2119"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=1403"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary-cat?post=1403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}