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

Added pybamm user id to 1000 and set its group to root #3947

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/source/user_guide/installation/install-from-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ Once you have pulled the Docker image, you can run a Docker container with the P

3. You can execute PyBaMM-related commands, run tests develop & contribute from the container.

.. note::

The default user for the container is ``pybamm`` with ``pybamm`` as password. The user belongs to
``sudoers`` and ``root`` group, so the sudo command can be issued to install additional packages to
the container. After a clean install, ``sudo apt-get update`` should be executed to update the source
list. Additional packages can be installed using ``sudo apt-get install [package_name]``.

Exiting the Docker container
----------------------------

Expand Down
5 changes: 3 additions & 2 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ FROM continuumio/miniconda3:latest
WORKDIR /

RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake pandoc texlive-latex-extra dvipng
RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake pandoc texlive-latex-extra dvipng sudo
RUN rm -rf /var/lib/apt/lists/*

RUN useradd -m -s /bin/bash pybamm
RUN useradd -m -s /bin/bash pybamm && echo "pybamm:pybamm" | chpasswd && adduser pybamm sudo
RUN usermod -ou 1000 -g 0 pybamm
USER pybamm

WORKDIR /home/pybamm/
Expand Down
Loading