Git Product home page Git Product logo

Comments (6)

wholtz avatar wholtz commented on June 1, 2024

Hello @bchalk101, thank you for your interest in micromamba.

The output from micromamba install is rather noisy and may have confused you. The key line of output is error No target prefix specified indicating you did not supply all the required parameters.
docker exec test micromamba install -n base -c conda-forge -y openssl
would be the full command to install openssl into the base environment (and it works for me with mambaorg/micromamba:0.21.0). If you then want to execute a program within a conda environment via a docker exec command, then you can make use of a new micromamba feature:
docker exec test micromamba run openssl
or if you want to avoid the "μmamba" ascii banner, then you could do:
docker exec test /usr/local/bin/_entrypoint.sh openssl

With that information, are you able to do what you need?

from micromamba-docker.

bchalk101 avatar bchalk101 commented on June 1, 2024

Hi @wholtz, thank you for working on it!

So not exactly, I was wondering if it is possible in the same manner that you can run docker run -it --rm --name test mambaorg/micromamba micromamba install python -c conda-forge and it activates the environment and runs the install within base, could that be done with docker exec.

The specific reason is that I have a Dockerfile, which installs python and other tools into the base conda environment within the image. I want to enable users to be able to run docker exec python <script>.py and it uses the python from within the base environment as you would with docker run, without having to use additional commands such as micromamba run or /usr/local/bin/_entrypoint.sh.

from micromamba-docker.

wholtz avatar wholtz commented on June 1, 2024

docker exec does not appear to execute .bashrc or .profile so I don't see way to implement exactly what you want.

There are some other options that I don't consider to be "clean" as they run programs from the conda environment without activating the conda environment. By placing python within $PATH you can get the behavior you desire. You could set PATH to include /opt/conda/bin or you can symlink /opt/conda/bin/python to /usr/local/bin/python:

docker run -it --rm --name test -d mambaorg/micromamba
docker exec test micromamba install -c conda-forge -y -n base python
docker exec -u 0:0 test ln -s /opt/conda/bin/python /usr/local/bin/python
docker exec test python --version

from micromamba-docker.

wholtz avatar wholtz commented on June 1, 2024

Just to clarify,

docker run -it --rm --name test mambaorg/micromamba micromamba install python -c conda-forge -y -n base

works because micromamba (which is not in a conda environment) is in /bin which is within the default $PATH.

from micromamba-docker.

maresb avatar maresb commented on June 1, 2024

@bchalk101 and @wholtz, in general, one possibility to achieve activation from docker exec is

docker exec -it containername bash -i -c "command"

from micromamba-docker.

wholtz avatar wholtz commented on June 1, 2024

Closing as I don't see a way to enable the requested functionality.

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.