{"id":1246,"date":"2024-07-23T12:16:11","date_gmt":"2024-07-23T12:16:11","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=1246"},"modified":"2024-07-23T12:21:39","modified_gmt":"2024-07-23T12:21:39","slug":"docker-build-secrets","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/fr\/wiki\/docker-build-secrets\/","title":{"rendered":"Docker Build Secrets"},"content":{"rendered":"<h1>Secrets de construction Docker : Un guide complet\n\nIntroduction\n\nLors de la construction d'images Docker, il est souvent n\u00e9cessaire d'utiliser des informations sensibles telles que des mots de passe, des cl\u00e9s API ou des certificats. Ces informations ne doivent pas \u00eatre expos\u00e9es dans l'image finale ou dans le contexte de construction. Docker propose plusieurs m\u00e9thodes pour g\u00e9rer les secrets de construction, chacune ayant ses propres avantages et inconv\u00e9nients. Cet article explorera ces m\u00e9thodes en d\u00e9tail.\n\nM\u00e9thodes pour g\u00e9rer les secrets de construction\n\n1. Utilisation de variables d'environnement\n\nLa m\u00e9thode la plus simple consiste \u00e0 utiliser des variables d'environnement. Cependant, cette approche pr\u00e9sente des risques de s\u00e9curit\u00e9 car les variables d'environnement peuvent \u00eatre consult\u00e9es par d'autres processus et peuvent \u00eatre accidentellement expos\u00e9es dans les journaux ou les images.\n\nExemple :\n```bash\ndocker build --build-arg SECRET_KEY=your_secret_key .\n```\n\nDockerfile :\n```dockerfile\nFROM alpine\nARG SECRET_KEY\nRUN echo $SECRET_KEY &gt; \/etc\/secret_key\n```\n\n2. Utilisation de fichiers secrets\n\nUne approche plus s\u00e9curis\u00e9e consiste \u00e0 utiliser des fichiers secrets. Docker permet de monter des fichiers secrets dans le contexte de construction \u00e0 l'aide de l'instruction `RUN --mount`.\n\nExemple :\n```bash\necho \"your_secret_key\" &gt; secret.txt\ndocker build --secret id=secret,src=secret.txt .\n```\n\nDockerfile :\n```dockerfile\nFROM alpine\nRUN --mount=type=secret,id=secret,target=\/etc\/secret_key cat \/etc\/secret_key\n```\n\n3. Utilisation de Docker secrets (Swarm ou Kubernetes)\n\nSi vous utilisez Docker Swarm ou Kubernetes, vous pouvez tirer parti de leurs syst\u00e8mes de gestion des secrets int\u00e9gr\u00e9s.\n\nPour Docker Swarm :\n```bash\ndocker secret create secret_key secret.txt\ndocker service create --name my_service --secret secret_key my_image\n```\n\nPour Kubernetes :\n```bash\nkubectl create secret generic secret-key --from-file=secret.txt\n```\n\nDockerfile :\n```dockerfile\nFROM alpine\nCOPY \/run\/secrets\/secret_key \/etc\/secret_key\n```\n\n4. Utilisation de multi-stage builds\n\nLes multi-stage builds permettent de s\u00e9parer le processus de construction de l'image finale, r\u00e9duisant ainsi le risque d'exposition des secrets.\n\nDockerfile :\n```dockerfile\n# \u00c9tape de construction\nFROM alpine as builder\nARG SECRET_KEY\nRUN echo $SECRET_KEY &gt; \/etc\/secret_key\n\n# \u00c9tape finale\nFROM alpine\nCOPY --from=builder \/etc\/secret_key \/etc\/secret_key\n```\n\n5. Utilisation d'outils externes\n\nPlusieurs outils externes peuvent aider \u00e0 g\u00e9rer les secrets de construction, tels que HashiCorp Vault, AWS Secrets Manager ou Azure Key Vault.\n\nExemple avec Vault :\n```bash\nvault kv get secret\/my-secret &gt; secret.txt\ndocker build --secret id=secret,src=secret.txt .\n```\n\nMeilleures pratiques\n\n1. \u00c9vitez d'inclure des secrets dans le contexte de construction.\n2. Utilisez des fichiers secrets ou des variables d'environnement avec pr\u00e9caution.\n3. Nettoyez les secrets apr\u00e8s la construction.\n4. Utilisez des images de base minimales pour r\u00e9duire la surface d'attaque.\n5. Mettez r\u00e9guli\u00e8rement \u00e0 jour vos images de base et vos d\u00e9pendances.\n6. Auditez et surveillez l'acc\u00e8s aux secrets.\n\nConclusion\n\nLa gestion des secrets de construction dans Docker n\u00e9cessite une r\u00e9flexion approfondie sur la s\u00e9curit\u00e9 et les meilleures pratiques. En utilisant les m\u00e9thodes d\u00e9crites dans cet article et en suivant les meilleures pratiques, vous pouvez garantir que vos informations sensibles restent s\u00e9curis\u00e9es tout au long du processus de construction de l'image Docker.<\/h1>\n<p>Docker Build Secrets is a feature that allows developers to securely manage sensitive data, such as <span class=\"glossaryai-tooltip glossary-term-1249\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\" target=\"_blank\">API<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une API, ou Interface de programmation, permet aux applications logicielles de communiquer et d'interagir entre elles. Elle d\u00e9finit des protocoles et des outils pour construire des logiciels et faciliter l'int\u00e9gration.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> cl\u00e9s, mots de passe et certificats, lors de la <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> Le processus de construction. Cette capacit\u00e9 est essentielle pour maintenir la s\u00e9curit\u00e9 et l'int\u00e9grit\u00e9 dans le d\u00e9veloppement d'applications modernes, o\u00f9 les informations sensibles doivent \u00eatre trait\u00e9es avec pr\u00e9caution pour \u00e9viter leur exposition \u00e0 des utilisateurs non autoris\u00e9s. \u00c0 mesure que la conteneurisation est devenue un \u00e9l\u00e9ment essentiel des pratiques DevOps, Docker Build Secrets offre une solution pour att\u00e9nuer les risques li\u00e9s \u00e0 l'encodage en dur d'informations sensibles dans les Dockerfiles, conduisant ainsi \u00e0 des applications plus s\u00e9curis\u00e9es et plus faciles \u00e0 maintenir.<\/p>\n<h2>Understanding Docker Build Secrets<\/h2>\n<p>Before diving deeper into Docker Build Secrets, it&#8217;s essential to grasp the broader context in which they operate. Docker images are built using Dockerfiles, which contain instructions on how to create a 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>. Traditional practices involve including sensitive information directly within these files or as build arguments, leading to potential security vulnerabilities. Docker Build Secrets provide an efficient method for handling sensitive data without exposing it 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\">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>.<\/p>\n<p>Introduced in Docker 18.09, this feature leverages the Docker BuildKit, a modern build subsystem that enhances the building process with features like improved caching and parallel processing. BuildKit allows you to handle secrets in a more controlled manner, ensuring that sensitive information is kept out of the <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>, journaux et contexte de build.<\/p>\n<h3>Key Features of Docker Build Secrets<\/h3>\n<ol>\n<li>\n<p><strong>Separation of Secrets from Application Code<\/strong>: Build Secrets ensure that sensitive data is not embedded 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> or the resulting <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>, reducing the risk of accidental exposure.<\/p>\n<\/li>\n<li>\n<p><strong>Limited Scope<\/strong>: Secrets are only available during the build process and are not persisted 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\">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>. This makes them usable only when needed and eliminates the risk of leakage.<\/p>\n<\/li>\n<li>\n<p><strong>Contr\u00f4le am\u00e9lior\u00e9<\/strong>: Les secrets de construction Docker offrent un contr\u00f4le plus granulaire sur les secrets expos\u00e9s \u00e0 quels services et conteneurs.<\/p>\n<\/li>\n<li>\n<p><strong>Int\u00e9gration avec les syst\u00e8mes de gestion des secrets<\/strong>: Les secrets de construction Docker peuvent \u00eatre int\u00e9gr\u00e9s avec des outils de gestion de secrets externes, ce qui simplifie le flux de travail et am\u00e9liore la s\u00e9curit\u00e9.<\/p>\n<\/li>\n<li>\n<p><strong>Simplicit\u00e9 et facilit\u00e9 d'utilisation<\/strong>Le processus d'utilisation des Build Secrets est simple, permettant aux d\u00e9veloppeurs de se concentrer sur la cr\u00e9ation d'applications sans se soucier des complexit\u00e9s des... <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management.<\/p>\n<\/li>\n<\/ol>\n<h2>Configuration de Docker BuildKit<\/h2>\n<p>To utilize Docker Build Secrets, you must first ensure that Docker BuildKit is enabled. You can enable BuildKit by setting the environment variable <code>DOCKER_BUILDKIT=1<\/code> before invoking the <code>docker build<\/code> command. Cela peut \u00eatre fait dans une session de terminal comme suit :<\/p>\n<pre><code class=\"language-bash\">export DOCKER_BUILDKIT=1<\/code><\/pre>\n<p>Alternatively, you can <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> the configuration to the Docker <span class=\"glossaryai-tooltip glossary-term-667\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/daemon\/\" target=\"_blank\">d\u00e9mon<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un d\u00e9mon est un processus d'arri\u00e8re-plan en informatique qui s'ex\u00e9cute de mani\u00e8re autonome, effectuant des t\u00e2ches sans intervention de l'utilisateur. Il g\u00e8re g\u00e9n\u00e9ralement des fonctions au niveau du syst\u00e8me ou de l'application, am\u00e9liorant ainsi l'efficacit\u00e9.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/daemon\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> param\u00e8tres. Sur Linux, par exemple, vous pouvez modifier le <code>\/etc\/docker\/daemon.json<\/code> fichier pour inclure ce qui suit :<\/p>\n<pre><code class=\"language-json\">{\n  \"fonctionnalit\u00e9s\": {\n    \"buildkit\": true\n  }\n}<\/code><\/pre>\n<p>Apr\u00e8s avoir apport\u00e9 cette modification, red\u00e9marrez le <span class=\"glossaryai-tooltip glossary-term-692\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-service\/\" target=\"_blank\">service Docker<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Service est un composant cl\u00e9 de Docker Swarm, permettant le d\u00e9ploiement et la gestion d'applications conteneuris\u00e9es sur un cluster de machines. Il g\u00e8re automatiquement l'\u00e9quilibrage de charge, la mise \u00e0 l'\u00e9chelle et la d\u00e9couverte des services.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl restart docker<\/code><\/pre>\n<h2>Cr\u00e9ation et utilisation des secrets de build<\/h2>\n<p>Once BuildKit is enabled, you can proceed to create and use Build Secrets in your Docker builds. The process consists of several key steps:<\/p>\n<h3>Step 1: Creating a Secret<\/h3>\n<p>Docker provides a command to create secrets that can be utilized in your build. For example, suppose you have a sensitive <span class=\"glossaryai-tooltip glossary-term-1249\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\" target=\"_blank\">API<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une API, ou Interface de programmation, permet aux applications logicielles de communiquer et d'interagir entre elles. Elle d\u00e9finit des protocoles et des outils pour construire des logiciels et faciliter l'int\u00e9gration.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> key stored in a file named <code>api_key.txt<\/code>. You can create a Docker <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> en utilisant la commande :<\/p>\n<pre><code class=\"language-bash\">echo \"your_api_key_here\" | docker <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> create my_api_key -<\/code><\/pre>\n<p>Cette commande cr\u00e9e un <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> nomm\u00e9 <code>my_api_key<\/code> containing the value of your <span class=\"glossaryai-tooltip glossary-term-1249\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\" target=\"_blank\">API<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une API, ou Interface de programmation, permet aux applications logicielles de communiquer et d'interagir entre elles. Elle d\u00e9finit des protocoles et des outils pour construire des logiciels et faciliter l'int\u00e9gration.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> cl\u00e9.<\/p>\n<h3>\u00c9tape 2 : Construire avec des secrets<\/h3>\n<p>To utilize the <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in your Docker build, you must reference it in 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> en utilisant le <code>--secret<\/code> flag. Here\u2019s a sample <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> that demonstrates how to use the <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-dockerfile\"># syntax=docker\/dockerfile:1.2\nFROM alpine:latest\n\n# Cr\u00e9er un r\u00e9pertoire pour l'application\n<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> mkdir \/app\n\n# <span class=\"glossaryai-tooltip glossary-term-673\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/copy\/\" target=\"_blank\">Copier<\/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 application code\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> . \/app\/\n\n# Use the secret\n<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> --mount=type=<span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>,id=my_api_key \n    export API_KEY=$(cat \/run\/secrets\/my_api_key) &amp;&amp; \n    .\/app --api-key=$API_KEY<\/code><\/pre>\n<h3>Step 3: Building the Image with the Secret<\/h3>\n<p>To build 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\">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> while passing the <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, use the following command:<\/p>\n<pre><code class=\"language-bash\">docker build --secret id=my_api_key,src=api_key.txt -t my_app .<\/code><\/pre>\n<p>This command instructs Docker to build 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\">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 utilisant le <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> you created earlier, ensuring that the sensitive information is injected into the build process without being included 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\">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>.<\/p>\n<h3>Step 4: Running the Image<\/h3>\n<p>After successfully building 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\">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>, you 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> it as you would with any other 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>:<\/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> my_app<\/code><\/pre>\n<p>In this step, it\u2019s important to note that the <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is no longer available to the running <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>. Cela garantit que les informations sensibles ne sont pas expos\u00e9es au-del\u00e0 de leur usage pr\u00e9vu.<\/p>\n<h2>Bonnes pratiques pour l'utilisation des secrets de construction Docker<\/h2>\n<p>Bien que Docker Build Secrets offre un m\u00e9canisme robuste pour g\u00e9rer les donn\u00e9es sensibles, il est crucial de suivre les meilleures pratiques pour maximiser la s\u00e9curit\u00e9 et l'efficacit\u00e9 :<\/p>\n<h3>1. Exposition minimale des secrets<\/h3>\n<p>N'utilisez des secrets que lorsque cela est absolument n\u00e9cessaire. \u00c9vitez d'inclure des secrets inutiles dans le processus de construction pour r\u00e9duire le risque d'exposition. <\/p>\n<h3>Utilisez les variables d'environnement avec discernement.<\/h3>\n<p>While it may be tempting to use environment variables to pass secrets to a running <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>, ensure that they are not logged or exposed in any <span class=\"glossaryai-tooltip glossary-term-1249\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\" target=\"_blank\">API<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une API, ou Interface de programmation, permet aux applications logicielles de communiquer et d'interagir entre elles. Elle d\u00e9finit des protocoles et des outils pour construire des logiciels et faciliter l'int\u00e9gration.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> calls or error messages.<\/p>\n<h3>3. Regularly Rotate Secrets<\/h3>\n<p>Regularly update and rotate your secrets to minimize the impact of potential exposures. Automated tools can assist in managing and rotating secrets effectively.<\/p>\n<h3>4. Integrate with Secrets Management Solutions<\/h3>\n<p>Consider integrating Docker Build Secrets with tools like HashiCorp Vault or AWS Secrets Manager to centralize <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management, making it easier to control access and audit usage.<\/p>\n<h3>5. Audit and Monitor<\/h3>\n<p>Surveillez et auditez en permanence votre utilisation des secrets. Assurez-vous que seuls les membres du personnel autoris\u00e9s ont acc\u00e8s aux informations sensibles et conservez des journaux de qui acc\u00e8de \u00e0 quoi.<\/p>\n<h2>Limitations of Docker Build Secrets<\/h2>\n<p>Malgr\u00e9 ses avantages, Docker Build Secrets pr\u00e9sente certaines limitations que les d\u00e9veloppeurs doivent conna\u00eetre :<\/p>\n<ol>\n<li>\n<p><strong>No Persistence<\/strong>: Secrets are not available to 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> once it is running. If your application requires access to the <span class=\"glossaryai-tooltip glossary-term-687\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\" target=\"_blank\">secret<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The concept of \"secret\" encompasses information withheld from others, often for reasons of privacy, security, or confidentiality. Understanding its implications is crucial in fields such as data protection and communication theory.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/secret\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> at runtime, you will need to manage this separately.<\/p>\n<\/li>\n<li>\n<p><strong>Limited Scope<\/strong>: Secrets are only available during the build phase and cannot be reused in subsequent builds without being passed again.<\/p>\n<\/li>\n<li>\n<p><strong>Compatibilit\u00e9<\/strong>: The Build Secrets feature requires BuildKit, which may not be available in older Docker versions. Ensure that you use a compatible version for seamless integration.<\/p>\n<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>Docker Build Secrets is a powerful tool for managing sensitive information during 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\">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> building process. By separating secrets from application code and ensuring limited exposure, Docker Build Secrets enhances security in containerized applications. As developers continue to embrace containerization, utilizing this feature will become increasingly crucial for maintaining secure practices.<\/p>\n<p>By following the steps outlined in this guide and adhering to best practices, developers can effectively integrate Docker Build Secrets into their workflows, ultimately leading to more secure, maintainable, and resilient applications. Whether you are working on a simple project or a complex microservices architecture, implementing Docker Build Secrets can significantly enhance your security posture and streamline your development process. As the landscape of software development evolves, adopting modern tools and practices like Docker Build Secrets will be essential for delivering robust applications in a secure manner.<\/p>","protected":false},"excerpt":{"rendered":"<p>Les secrets Docker Build am\u00e9liorent la s\u00e9curit\u00e9 lors de la <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> build process by allowing sensitive data, such as <span class=\"glossaryai-tooltip glossary-term-1249\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\" target=\"_blank\">API<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une API, ou Interface de programmation, permet aux applications logicielles de communiquer et d'interagir entre elles. Elle d\u00e9finit des protocoles et des outils pour construire des logiciels et faciliter l'int\u00e9gration.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/api\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> keys or passwords, to be securely passed without being included 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\">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>.<\/p>","protected":false},"author":1,"featured_media":1809,"parent":0,"template":"","glossary-cat":[],"class_list":["post-1246","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>Docker Build Secrets - 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\/docker-build-secrets\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Build Secrets - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"Docker Build Secrets enhance security during the image build process by allowing sensitive data, such as API keys or passwords, to be securely passed without being included in the final image.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-build-secrets\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-23T12:21:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.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\/docker-build-secrets\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/\",\"name\":\"Docker Build Secrets - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg\",\"datePublished\":\"2024-07-23T12:16:11+00:00\",\"dateModified\":\"2024-07-23T12:21:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg\",\"width\":800,\"height\":600,\"caption\":\"docker-build-secrets-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#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\":\"Docker Build Secrets\"}]},{\"@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":"Docker Build Secrets - 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\/docker-build-secrets\/","og_locale":"fr_FR","og_type":"article","og_title":"Docker Build Secrets - Dockerpros","og_description":"Docker Build Secrets enhance security during the image build process by allowing sensitive data, such as API keys or passwords, to be securely passed without being included in the final image.","og_url":"https:\/\/dockerpros.com\/fr\/wiki\/docker-build-secrets\/","og_site_name":"Dockerpros","article_modified_time":"2024-07-23T12:21:39+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.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\/docker-build-secrets\/","url":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/","name":"Docker Build Secrets - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg","datePublished":"2024-07-23T12:16:11+00:00","dateModified":"2024-07-23T12:21:39+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-build-secrets_1246.jpg","width":800,"height":600,"caption":"docker-build-secrets-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/docker-build-secrets\/#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":"Docker Build Secrets"}]},{"@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\/1246","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\/1246\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/1809"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary-cat?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}