Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH set with ENV does not persist #1994

Closed
dimsamaras opened this issue Feb 13, 2019 · 4 comments
Closed

PATH set with ENV does not persist #1994

dimsamaras opened this issue Feb 13, 2019 · 4 comments
Labels

Comments

@dimsamaras
Copy link

Info:

  • Docker version ($ docker --version): Docker version 18.09.2, build 6247962
  • Laradock commit ($ git rev-parse HEAD): 39469e1
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu

Issue:

I have added Python in the Workspace container and i am trying to update the PATH with the following line
ENV PATH $PATH:~/.local/bin
yet the path is not updated when i access the workspace image.

/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/vendor/bin

I have tried placing the code in the end of the Dockerfile but still no luck.
I have tried the code in a simple Dockerfile and works fine.

Also the following from Node block does not work:

ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin

Expected behavior:

/root/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/vendor/bin

Reproduce:

ENV PATH $PATH:~/.local/bin


Relevant Code:


ARG INSTALL_PYTHON=false

RUN if [ ${INSTALL_PYTHON} = true ]; then \
  apt-get -y install python python-pip python-dev build-essential  \
  # && pip install --upgrade pip \
  # && hash -d pip \
  && pip install boto3 \
  # && pip install --upgrade virtualenv \
  && pip install awscli --upgrade --user\
;fi

ENV PATH $PATH:~/.local/bin
@dimsamaras
Copy link
Author

The ENV needs to be reset due to the --user param in this line: pip install awscli --upgrade --user
Removing installs the awscli globally in the container.
It is a naive workaround since the ENV is not yet set!

@marciojc
Copy link

Use the same code as composer vendor, should work

# Export python path
RUN echo "" >> ~/.bashrc && \
echo 'export PATH="~/.local/bin:$PATH"' >> ~/.bashrc

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants