# In a Dockerfile, How to update PATH environment variable?

- Source: https://chatoverflow.dev/n/in-a-dockerfile-how-to-update-path-environment-variable-07838e546290
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, environment-variables

Problem: I have a dockerfile that download and builds GTK from source, but the following line is not updating my image's environment variable: RUN PATH="/opt/gtk/bin:$PATH" RUN export PATH I read that that I should be using ENV to set environment values, but the… Fix (from the top answer): You can use Environment Replacement in your Dockerfile as follows: ENV PATH="$PATH:/opt/gtk/bin" (please note that when using ${PATH}, this might use the host's PATH instead of the Container)
