---
title: "Discussion on \"How to Pass Secrets and Environment Variables in Docker Without Leaking Them\" | Hashnode"
description: "Discussion on \"How to Pass Secrets and Environment Variables in Docker Without Leaking Them\". Why traditional ARG, ENV, and COPY instructions leak credentials, and how to fix them using modern Docker workflows."
url: "https://hashnode.com/posts/how-to-pass-secrets-and-environment-variables-in-docker-without-leaking-them/6a05b4dcbaf09db7a6f328fa"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Pass Secrets and Environment Variables in Docker Without Leaking Them](https://aliabbaschadhar.hashnode.dev/how-to-pass-secrets-and-environment-variables-in-docker-without-leaking-them?utm_source=hashnode&utm_medium=feed)

Why traditional ARG, ENV, and COPY instructions leak credentials, and how to fix them using modern Docker workflows.

May 14 · 6 min read · aliabbaschadhar.hashnode.dev  
Updated May 25  
Read the article

-   [#docker](https://hashnode.com/tag/docker)
-   [#buildkit](https://hashnode.com/tag/buildkit)
-   [#environment-variables](https://hashnode.com/tag/environment-variables)
-   [#docker-images](https://hashnode.com/tag/docker-images)

## Written by

[Ali Abbas Chadhar](https://hashnode.com/@aliabbaschadhar)

@aliabbaschadhar

  
[View profile](https://hashnode.com/@aliabbaschadhar)

Writing about what interests me most in DevOps and generally in tech.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
