Giter Site home page Giter Site logo

After starting the container with NB_USER=root, NB_UID=0, and NB_GID=0, $HOME environment variable is still /home/jovyan about docker-stacks HOT 3 CLOSED

anil-resero avatar anil-resero commented on June 3, 2024
After starting the container with NB_USER=root, NB_UID=0, and NB_GID=0, $HOME environment variable is still /home/jovyan

from docker-stacks.

Comments (3)

mathbunnyru avatar mathbunnyru commented on June 3, 2024 1

4. Check $HOME

I think you're checking it wrong.
You are probably doing docker exec -it CONTAINER_ID bash and then echo $HOME.
This way it will indeed show /home/jovyan.
The reason for this is that the Dockerfile was built with ENV /home/jovyan.
I think there is no way to change during runtime the env variable saved for the image, so it will stay like this.

I checked Jupyter Terminal and Jupyter Lab (notebook) - and $HOME is /home/root in both cases, which is correct.

from docker-stacks.

mathbunnyru avatar mathbunnyru commented on June 3, 2024 1

@anil-resero
If you really need to have $HOME to be /home/root when running docker exec commands, then I suggest you create your own Dockerfile like this:

FROM quay.io/jupyter/datascience-notebook:2024-01-16
ENV HOME=/home/root

Then just build and use this image.

I have tested this and it works:

docker build -t test .
docker run -it --rm --user root -p 8888:8888 -e NB_UID=0 -e NB_GID=0 -e NB_USER=root -e NOTEBOOK_ARGS="--allow-root" test

Then it shows /home/root even in docker exec ...

from docker-stacks.

benz0li avatar benz0li commented on June 3, 2024

@anil-resero Did you docker exec -ti happy_sutherland bash into the container?

from docker-stacks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.