Git Product home page Git Product logo

Comments (6)

wholtz avatar wholtz commented on June 7, 2024 1

To enable installing conda packages as root and then using them as an arbitrary non-root use, I think only the location/permissions for the file referenced by BASH_ENV needs to change. /opt/conda currently has permissions 755.

Setting BASH_ENV to /etc/bash.bashrc might be a good way to go.

from micromamba-docker.

wholtz avatar wholtz commented on June 7, 2024 1

Implemented in dc4bf68.

from micromamba-docker.

wholtz avatar wholtz commented on June 7, 2024

Hi @Midnighter -- thank you for your interest in Micromamba. Here is one approach that you could take:

FROM mambaorg/micromamba:0.12.0

RUN groupadd conda && \
        useradd --home-dir /home/conda --create-home --shell /bin/bash --skel /dev/null -g conda conda

RUN chown -R conda.conda /opt/conda

USER conda

ENV BASH_ENV /home/conda/.bashrc

RUN /bin/micromamba shell init -s bash -p $MAMBA_ROOT_PREFIX && \
        echo "micromamba activate base" >> ~/home/conda/.bashrc

I am working on updating the image to make this more straight forward, but I'm not sure when I'll get that wrapped up.

from micromamba-docker.

Midnighter avatar Midnighter commented on June 7, 2024

Thank you for the suggestion! If it's easier to outline what you have in mind than to actually do it, feel free to post it here and I can work on the changes.

from micromamba-docker.

srstsavage avatar srstsavage commented on June 7, 2024

FWIW, I was able to use a non-root user just by clearing BASH_ENV and bootstrapping the non-root user's .bashrc:

ENV BASH_ENV=
RUN /bin/micromamba shell init -s bash -p $MAMBA_ROOT_PREFIX && \
  echo "micromamba activate base" >> $HOME/.bashrc

from micromamba-docker.

Midnighter avatar Midnighter commented on June 7, 2024

Another interesting point on this topic would be to make the pre-installed tools available to any user. The scenario I describe is that I would create a Docker image derived from the micromamba image and install a couple of conda packages as root. Then I run that image with a non-root id, for example, docker run -u 1001:10001.

In order for any user id to be able to use the conda packages, the BASH_ENV should have permissions to be read by all (so maybe it should be in a different place), and /opt/conda would need read permissions for all, as well as binaries need to be executable by all.

I would do all of this in my derived image definition but I wanted to ask for your feedback if you think that's a decent approach.

from micromamba-docker.

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.