Dockerfile:
Код: Выделить всё
FROM mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04
# Set work dir
WORKDIR /
# Define environment variables for Conda
ENV CONDA_PREFIX=/azureml-envs/myenv
ENV CONDA_DEFAULT_ENV=$CONDA_PREFIX
ENV PATH=$CONDA_PREFIX/bin:$PATH
# This is needed for mpi to locate libpython
ENV LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
# Copy the environment.yml file to the image
COPY conda.yml .
# Set up Conda configuration
RUN conda config --add channels https://.blob.core.windows.net// && \
conda config --set channel_priority strict && \
conda config --remove channels defaults && \
conda config --set offline true
# Create the Conda environment
RUN conda env create -p $CONDA_PREFIX -f conda.yml && \
rm environment.yml && \
conda run -p $CONDA_PREFIX pip cache purge && \
conda clean -a -y
файл conda:
Код: Выделить всё
dependencies:
- python=3.9
- pip
- pip:
- https://.blob.core.windows.net///*.whl
- https://.blob.core.windows.net///*.whl
# more packages
Код: Выделить всё
2024-06-27T15:06:47: Step 8/9 : RUN conda config --add channels https://.blob.core.windows.net// && conda config --set channel_priority strict && conda config --remove channels defaults && conda config --set offline true
2024-06-27T15:06:47: ---> Running in ******
2024-06-27T15:06:51: Removing intermediate container *******
2024-06-27T15:06:51: ---> ************
2024-06-27T15:06:51: Step 9/9 : RUN conda env create -p $CONDA_PREFIX -f conda.yml && rm environment.yml && conda run -p $CONDA_PREFIX pip cache purge && conda clean -a -y
2024-06-27T15:06:51: ---> Running in ***************
2024-06-27T15:06:52: Channels:
2024-06-27T15:06:52: -
2024-06-27T15:06:52: Platform: linux-64
2024-06-27T15:06:52: Collecting package metadata (repodata.json): ...working... done
2024-06-27T15:06:52: Solving environment: ...working... failed
2024-06-27T15:06:52: [91m
2024-06-27T15:06:52: PackagesNotFoundError: The following packages are missing from the target environment:
2024-06-27T15:06:52: - python=3.9*
2024-06-27T15:06:52: - pip
2024-06-27T15:06:52: The command '/bin/sh -c conda env create -p $CONDA_PREFIX -f conda.yml && rm conda.yml && conda run -p $CONDA_PREFIX pip cache purge && conda clean -a -y' returned a non-zero code: 1
2024-06-27T15:06:52: [0m
2024-06-27T15:06:52: CalledProcessError(1, ['docker', 'build', '-f', 'Dockerfile', '.', '-t', '***.azurecr.io/azureml/*****', '-t', '*****.azurecr.io/azureml/*********:1'])
2024-06-27T15:06:52: Building docker image failed with exit code: 1
Подробнее здесь: https://stackoverflow.com/questions/786 ... ing-enviro