Notes on custom ollama container

# Use the ollama base image. Adjust the tag if needed.
FROM ollama/ollama:latest

# Install required utilities (wget and bzip2 are used by the Miniconda installer)
RUN apt-get update && \
    apt-get install -y git wget bzip2 && \
    rm -rf /var/lib/apt/lists/*

# Download and install Miniconda to /opt/conda without requiring user interaction
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
    /bin/bash /tmp/miniconda.sh -b -p /opt/conda && \
    rm /tmp/miniconda.sh

# Add conda to PATH for all subsequent commands
ENV PATH=/opt/conda/bin:$PATH

# Update conda (optional, but helps ensure you’re using a current version)
RUN conda update -n base -c defaults conda -y

# Create a new default conda environment named "default_env" with Python 3.9
RUN conda create -n default_env python=3.11 -y

# Install the OpenAI SDK inside the "default_env" using pip.
# We call pip from the specific environment's binary path.
RUN /opt/conda/envs/default_env/bin/pip install openai

# Adjust the PATH so the default environment’s executables take precedence
ENV PATH=/opt/conda/envs/default_env/bin:$PATH
ENV CONDA_DEFAULT_ENV=default_env

# Optional: set working directory and default command
WORKDIR /app
CMD [ "bash" ]

Updated on August 7, 2025