Skip to content

Instantly share code, notes, and snippets.

@poptree
Created February 8, 2023 11:43
Show Gist options
  • Save poptree/9982a3b8470e432c30591dc661a12d86 to your computer and use it in GitHub Desktop.
Save poptree/9982a3b8470e432c30591dc661a12d86 to your computer and use it in GitHub Desktop.
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
# Remove any third-party apt sources to avoid issues with expiring keys.
RUN rm -f /etc/apt/sources.list.d/*.list
# Install some basic utilities.
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
tmux \
wget \
build-essential \
git \
zsh \
vim \
curl \
dirmngr \
gpg\
rsync \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
# Create a non-root user and switch to it.
RUN adduser -u 1004 --disabled-password --gecos '' --shell /bin/bash user \
&& chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user
# All users can use /home/user as their home directory.
ENV HOME=/home/user
RUN mkdir $HOME/.cache $HOME/.config \
&& chmod -R 777 $HOME
# # set zsh
# RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
# RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
# && git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Download and install Micromamba.
RUN curl -sL https://micro.mamba.pm/api/micromamba/linux-64/1.1.0 \
| sudo tar -xvj -C /usr/local bin/micromamba
ENV MAMBA_EXE=/usr/local/bin/micromamba \
MAMBA_ROOT_PREFIX=/home/user/micromamba \
CONDA_PREFIX=/home/user/micromamba \
PATH=/home/user/micromamba/bin:$PATH
# # Set up the base Conda environment by installing PyTorch and friends.
# COPY conda-linux-64.lock /app/conda-linux-64.lock
# RUN micromamba create -qy -n base -f /app/conda-linux-64.lock \
# && rm /app/conda-linux-64.lock \
# && micromamba shell init --shell=bash --prefix="$MAMBA_ROOT_PREFIX" \
# && micromamba clean -qya
# Set the default command to zsh.
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment