-
Notifications
You must be signed in to change notification settings - Fork 19
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
installing micromamba in docker (error message "error: process ID out of range" is fixable) - AND non-root user needs to call ~/.local/bin/micromamba but root can call micromamba without path information. #68
Comments
I have tried In that script I put a debug output for get information about the variable ARG USERNAME=appuser
RUN useradd --create-home ${USERNAME}
WORKDIR /home/${USERNAME}
USER ${USERNAME}
COPY _activate_current_env.sh /usr/local/bin/
# Install micromamba for non-root user
RUN (bash <(curl -L micro.mamba.pm/install.sh))
RUN hash -r ; \
source ~/.bashrc ; \
source /usr/local/bin/_activate_current_env.sh ; \
micromamba self-update ; \
micromamba shell init -s bash -r ~/micromamba ; \
hash -r ; \
source ~/.bashrc ; \
micromamba info Error Output (reason
|
|
@Hind-M , thanks for update pointer. Here comes my test results, 1 installation problems:
Proposed optimization 1 micromamba-releases/install.sh Line 6 in 30453f7
In my case a work around the 2 problems while interacting with an installed micromamba Just to have more information about the kind of shell, which is evaluation the
And that is the reason why calling
As far as I understand the console "way of live" in linux terminal or via GUI-terminal (after reading an easy to understand information about DotFiles at https://mywiki.wooledge.org/DotFiles ) ,
I think a docker container, which is running via i.e. a Gitlab-Runner for handling build jobs couldn't be a interactive shell. Here the output of two different
Proposed optimization 2 |
my problem are discussed last year
My tests prove, the issue is a current problem (in micromamba version 2.0.4 for non-interactive shells), too. My above testresults #68 (comment) # since sourcing bashrc didnt help, try to set MAMBA_EXE for docker build on my own.
ARG MAMBA_EXE=/home/${USERNAME}/.local/bin/micromamba
ARG MAMBA_ROOT_PREFIX=/home/${USERNAME}/micromamba
#
RUN hash -r ; \
source ~/.bashrc ; \
echo "value of MAMBA_EXE : \"$MAMBA_EXE\" " ; \
source /usr/local/bin/_activate_current_env.sh ; \
micromamba self-update ; \
micromamba shell init -s bash -r ~/micromamba ; \
hash -r ; \
source ~/.bashrc ; \
micromamba info
|
An additional test: Adding SHELL ["/bin/bash", "-c"]
ARG USERNAME=appuser
RUN useradd --create-home ${USERNAME}
WORKDIR /home/${USERNAME}
USER ${USERNAME}
COPY _activate_current_env.sh /usr/local/bin/
# Install micromamba for non-root user
RUN (bash <(curl -L micro.mamba.pm/install.sh))
# since sourcing bashrc didnt help, try to set MAMBA_EXE for docker build on my own.
ARG MAMBA_EXE=/home/${USERNAME}/.local/bin/micromamba
ARG MAMBA_ROOT_PREFIX=/home/${USERNAME}/micromamba
# since bashrc wouldnot become evaluated while calling docker run, we make sure to set the environment
ENV MAMBA_EXE=$MAMBA_EXE
ENV MAMBA_ROOT_PREFIX=$MAMBA_ROOT_PREFIX
RUN hash -r ; \
source ~/.bashrc ; \
source /usr/local/bin/_activate_current_env.sh ; \
micromamba self-update ; \
micromamba shell init -s bash -r ~/micromamba ; \
hash -r ; \
source ~/.bashrc ; \
micromamba info Output of
|
An last test (for today), using the created docker image inside Windows WSL as container with interactive shell,
|
When installing Micromamba by calling the installation script within a file that is processed by docker build, error messages occur.
Micromamba has been installed once for root and once for a non-root user within the container.
In the Dockerfile Micromamba can be called without specifying a path for root users after installation.
However, when not using root, the path to Micromamba must always be included when calling it in the Dockerfile.
For installation in Dockerfile I use that line
RUN bash <(curl -L micro.mamba.pm/install.sh)
I adapted the information from here:
micromamba-releases/README.md
Lines 13 to 15 in 30453f7
Build output with error message
The error message comes from that code line in installation script:
micromamba-releases/install.sh
Line 6 in 30453f7
Build output with error message
I found while
docker build
the value of$PPID
is0
.Adding a pair of braces in the RUN command of dockerfile, the error went away.
RUN (bash <(curl -L micro.mamba.pm/install.sh))
After sourcing
~/.bashrc
micromamba could be used by root user in docker container.Sadly installing Micromamba for a non-root user via
Dockerfile
has more problemsa) The installation gives above error message about process id, too. Fixable by using an additional pair of braces in
RUN
command.b) After installation micromamba is not callable after sourcing
~/.bashrc
without path.Content of dockerfile for installing micromamba for non-root user
I have used
echo
andcat
andgrep
for debugging downbelow, but did not find the reason.Installation output without error message, because of additional brace in
RUN
-line:Here is the output of calling as non-root
The text was updated successfully, but these errors were encountered: