Skip to content

Commit

Permalink
fix(docker): .profile --> .bash_aliases. removed /bin/conda causing i…
Browse files Browse the repository at this point in the history
…nit error. installed main base into base env
  • Loading branch information
pranavmishra90 committed Jul 4, 2024
1 parent 9596784 commit 07b1c00
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 23 deletions.
10 changes: 8 additions & 2 deletions docker/base/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ echo -ne "\033]0;$server_name\a"

echo """
Welcome to the Facsimilab suite of docker images.
For more information, please visit github.com/pranavmishra90/facsimilab-platform
Available python environments:
"""


micromamba env list


echo """
----------------------------------------------------------------------------------
"""


# Aliases
alias mamba='micromamba'
4 changes: 2 additions & 2 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ RUN apt-get update && \
sudo \
tini \
unzip \
zoxide \
zsh && \
apt-get clean && rm -rf /var/lib/apt/lists/*

Expand All @@ -62,7 +63,6 @@ ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"

COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba "$MAMBA_EXE" /bin/conda
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
COPY --from=micromamba /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh
Expand All @@ -85,7 +85,7 @@ WORKDIR ${MAMBA_USER_WORK_DIR}

COPY --chown=$MAMBA_USER:$MAMBA_USER .profile /home/${MAMBA_USER}/.profile
RUN echo "Facsimilab-Base $facsimilab_version_num" > /home/${MAMBA_USER}/.server_name.txt
RUN cat /home/${MAMBA_USER}/.profile >> /home/${MAMBA_USER}/.bashrc
RUN cat /home/${MAMBA_USER}/.profile > /home/${MAMBA_USER}/.bash_aliases


SHELL ["/usr/local/bin/_dockerfile_shell.sh"]
Expand Down
27 changes: 26 additions & 1 deletion docker/full/.profile
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#!/bin/bash

# Alias
# Join Message
server_name=$(cat ~/.server_name.txt )

echo -e "\e[1;31m$server_name\e[0m"

# Set Windows Terminal Tab Name
echo -ne "\033]0;$server_name\a"


# Join paragraph

echo """
Welcome to the Facsimilab suite of docker images.
For more information, please visit github.com/pranavmishra90/facsimilab-platform
Available python environments:
"""


micromamba env list


echo """
----------------------------------------------------------------------------------
"""


alias mamba='micromamba'
2 changes: 1 addition & 1 deletion docker/full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ WORKDIR /home/${MAMBA_USER}/work
# Add the bash profile
COPY --chown=$MAMBA_USER:$MAMBA_USER .profile /home/${MAMBA_USER}/.profile
RUN echo "Facsimilab-Full $facsimilab_version_num" > /home/${MAMBA_USER}/.server_name.txt
RUN cat /home/${MAMBA_USER}/.profile >> /home/${MAMBA_USER}/.bashrc
RUN cat /home/${MAMBA_USER}/.profile > /home/${MAMBA_USER}/.bash_aliases

SHELL ["/usr/local/bin/_dockerfile_shell.sh"]

Expand Down
41 changes: 26 additions & 15 deletions docker/main/.profile
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#!/bin/bash

# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
export MAMBA_EXE='/usr/bin/micromamba';
export MAMBA_ROOT_PREFIX='/home/coder/micromamba';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<


# Alias
# Join Message
server_name=$(cat ~/.server_name.txt )

echo -e "\e[1;31m$server_name\e[0m"

# Set Windows Terminal Tab Name
echo -ne "\033]0;$server_name\a"


# Join paragraph

echo """
Welcome to the Facsimilab suite of docker images.
For more information, please visit github.com/pranavmishra90/facsimilab-platform
Available python environments:
"""


micromamba env list


echo """
----------------------------------------------------------------------------------
"""


alias mamba='micromamba'
4 changes: 2 additions & 2 deletions docker/main/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY environment.yml /tmp/base-environment.yml


RUN --mount=type=cache,target=/home/${MAMBA_USER}/cache \
micromamba create -y -f /tmp/base-environment.yml \
micromamba install -y -n base -f /tmp/base-environment.yml \
&& micromamba clean --all --yes


Expand Down Expand Up @@ -82,7 +82,7 @@ WORKDIR /home/${MAMBA_USER}/work

COPY --chown=$MAMBA_USER:$MAMBA_USER .profile /home/${MAMBA_USER}/.profile
RUN echo "Facsimilab-Main $facsimilab_version_num" > /home/${MAMBA_USER}/.server_name.txt
RUN cat /home/${MAMBA_USER}/.profile >> /home/${MAMBA_USER}/.bashrc
RUN cat /home/${MAMBA_USER}/.profile > /home/${MAMBA_USER}/.bash_aliases


SHELL ["/usr/local/bin/_dockerfile_shell.sh"]
Expand Down

0 comments on commit 07b1c00

Please sign in to comment.