Skip to content

Commit

Permalink
Merge pull request NVIDIA-AI-Blueprints#32 from ruromero/fix-build
Browse files Browse the repository at this point in the history
chore: force use of bash
  • Loading branch information
ruromero authored Feb 24, 2025
2 parents ec9f1f9 + fca5e48 commit 1cde54b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ ENV PATH=/opt/conda/bin:$PATH

# Install Mamba, a faster alternative to conda, within the base environment
RUN --mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
conda install -y mamba -n base -c conda-forge
bash -c "conda install -y mamba -n base -c conda-forge"

# Create base environment
RUN --mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
conda create -y --name morpheus-vuln-analysis
bash -c "conda create -y --name morpheus-vuln-analysis"

# Activate the environment (make it default for subsequent commands)
RUN echo "source activate morpheus-vuln-analysis" >> ~/.bashrc
Expand All @@ -48,15 +48,15 @@ RUN echo "source activate morpheus-vuln-analysis" >> ~/.bashrc
SHELL ["/bin/bash", "-c"]

# Add conda channels required for the Morpheus dependencies
RUN source activate morpheus-vuln-analysis \
RUN bash -c "source activate morpheus-vuln-analysis \
&& conda config --env --add channels conda-forge \
&& conda config --env --add channels nvidia \
&& conda config --env --add channels rapidsai \
&& conda config --env --add channels pytorch
&& conda config --env --add channels pytorch"

RUN --mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
source activate morpheus-vuln-analysis &&\
mamba install -y -c conda-forge tini=0.19
bash -c "source activate morpheus-vuln-analysis &&\
mamba install -y -c conda-forge tini=0.19"

WORKDIR /workspace/

Expand All @@ -69,8 +69,8 @@ SHELL ["/bin/bash", "-c"]
# Install dependencies
RUN --mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
source activate morpheus-vuln-analysis &&\
mamba env update -f ./requirements.yaml
bash -c "source activate morpheus-vuln-analysis &&\
mamba env update -f ./requirements.yaml"

# If any changes have been made from the base image, recopy the sources
COPY . /workspace/
Expand All @@ -88,13 +88,13 @@ FROM base as runtime

RUN --mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
source activate morpheus-vuln-analysis &&\
bash -c "source activate morpheus-vuln-analysis &&\
mamba install -y -c conda-forge \
ipywidgets \
jupyter_contrib_nbextensions \
# notebook v7 is incompatible with jupyter_contrib_nbextensions
notebook=6 &&\
jupyter contrib nbextension install --user &&\
pip install jupyterlab_nvdashboard==0.9
pip install jupyterlab_nvdashboard==0.9"

CMD ["jupyter-lab", "--no-browser", "--allow-root", "--ip='*'", "--port=8000", "--NotebookApp.token=''", "--NotebookApp.password=''"]

0 comments on commit 1cde54b

Please sign in to comment.