Skip to content

Instantly share code, notes, and snippets.

@ruliana
Created February 11, 2025 13:22
Show Gist options
  • Save ruliana/50e8e751ae0dc6af2a6b08d08bf2a027 to your computer and use it in GitHub Desktop.
Save ruliana/50e8e751ae0dc6af2a6b08d08bf2a027 to your computer and use it in GitHub Desktop.
Dockerfile to build an environment compatible with Stanford's XCS236 from 2025
# Use Miniconda as base image
FROM continuumio/miniconda3
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
zsh \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Oh My Zsh for better zsh experience
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Copy environment files
COPY environment.yml /tmp/environment.yml
# Create conda environment
RUN conda env create -f /tmp/environment.yml
# Set up conda init for zsh
RUN conda init zsh
# Add conda environment activation to zshrc
RUN echo "conda activate XCS236" >> ~/.zshrc
# Set zsh as default shell
SHELL ["/bin/zsh", "-c"]
# Set working directory
WORKDIR /workspace
# Keep container running
CMD ["zsh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment