Dockerfile ARG ↔ ENV Converter

ARG defines build-time variables; ENV defines runtime variables. Common pattern: declare both so you can override at build OR runtime. This converter takes a list of ARG/ENV directives and converts between forms.

ARG vs ENV quick reference

ARGBuild-time only. Available during docker build. NOT in the final image\'s environment.
ENVBoth build-time AND runtime. Set in the image, available to processes inside the container.
Common patternARG VERSION=1.0
ENV VERSION=$VERSION
Lets you override at build (--build-arg VERSION=2.0) and the value persists at runtime.
SecretsNever use ENV for secrets (persisted in image layers). Use Docker BuildKit secrets or runtime env-files.

How to use the Dockerfile ARG ↔ ENV Converter

Paste your existing ARG or ENV lines. Pick what to convert to. The output handles defaults (ARG =value) correctly.