-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.conda
75 lines (56 loc) · 2.38 KB
/
Dockerfile.conda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright [2025] [SkywardAI]
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Use Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
PATH="/opt/conda/bin:$PATH"
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
bzip2 \
build-essential \
zsh \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install ubuntu-drivers-common
RUN apt-get update && \
apt-get install -y ubuntu-drivers-common && \
rm -rf /var/lib/apt/lists/*
# Install NVIDIA drivers
RUN ubuntu-drivers autoinstall
# Install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh && \
/opt/conda/bin/conda clean --all -y
# Create a new Conda environment with Python 3.10
RUN /opt/conda/bin/conda create -y --name py310 python=3.10
# Install PyTorch with CUDA support using conda run
RUN /opt/conda/bin/conda run -n py310 conda install -y pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
# Install Oh My Zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Set Zsh as the default shell
RUN chsh -s $(which zsh)
# Ensure the Conda environment is activated by default in new zsh sessions
RUN echo "source /opt/conda/bin/activate py310" >> /root/.zshrc
# Set the working directory
WORKDIR /workspace
# (Optional) Copy your application code into the container
# COPY . /workspace
LABEL org.opencontainers.image.authors="SkywardAI Labs" \
org.opencontainers.image.url=https://github.com/SkywardAI/bundoora \
org.opencontainers.image.source=https://github.com/SkywardAI/bundoora/blob/main/Dockerfile.latex
# Set the default shell to Zsh
CMD ["zsh"]