-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (33 loc) · 1.4 KB
/
Dockerfile
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
# Use Ubuntu 24.10 as the base image
FROM ubuntu:24.10
# Install necessary packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
iptables \
supervisor
# Install Docker using a script from Docker's official website
RUN curl -fsSL https://get.docker.com | sh
# Install NVIDIA Container Toolkit for GPU support
RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
&& apt-get update \
&& apt-get install -y nvidia-container-toolkit \
&& nvidia-ctk runtime configure --runtime=docker \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy entrypoint script and Supervisor configuration files into the container
COPY entrypoint.sh /usr/local/bin/
COPY supervisor/ /etc/supervisor/conf.d/
# Make entrypoint script executable
RUN chmod +x /usr/local/bin/entrypoint.sh
# Create a volume for Docker's data directory
VOLUME /var/lib/docker
# Define the entrypoint for the container
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Default command to run if no other command is specified
CMD ["bash"]