Answer the question
In order to leave comments, you need to log in
Docker. Why does the environment variable disappear when switching to another user?
1st container sets PATH variable for docker user
FROM ubuntu:15.10
USER root
RUN groupadd -r docker && useradd -r -g docker docker
USER docker
ENV PATH /hello-world:$PATH
FROM step_1
USER root
Answer the question
In order to leave comments, you need to log in
When I go into the second container and switch to the docker user, the PATH variable is reset
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question