arrow_back
Back

Dockerfile ENV: environment variables in images

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

ENV sets environment variables inside the image. Variables defined here are available in subsequent instructions and at runtime inside the container.

Example:

ENV MY_VERSION 1.3
RUN apt-get install -y mypackage=$MY_VERSION

Two formats:

ENV <KEY>=<VALUE>
ENV <KEY> <VALUE>
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Dockerfile ENTRYPOINT: fixed container entry command

arrow_forward