forked from In-For-Disaster-Analytics/LLMRepository-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.gpu
72 lines (55 loc) · 1.55 KB
/
Dockerfile.gpu
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
FROM nvidia/cuda:12.3.0-devel-ubuntu22.04
LABEL maintainer="TACC-ACI-WMA <wma_prtl@tacc.utexas.edu>"
USER root
EXPOSE 8888
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
fonts-liberation \
git \
locales \
pandoc \
python3 \
python3-pip \
ssh \
wget \
unzip \
vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
RUN pip install --upgrade --no-cache-dir \
pip \
setuptools \
wheel
# Install jupyterlab and ML packages using host cache
RUN --mount=type=cache,target=/root/.cache/pip \
pip install \
jupyterlab \
tensorflow[and-cuda] \
torch
# Add container user and group
ARG NB_USER=jovyan
ARG NB_UID=1000
ARG NB_GID=100
# Configure environment
ENV SHELL=/bin/bash \
NB_USER="${NB_USER}" \
NB_UID=${NB_UID} \
NB_GID=${NB_GID} \
NB_HOME="/home/${NB_USER}" \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
# Enable prompt color in the skeleton .bashrc before creating the default NB_USER
RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc
# Create NB_USER with UID=NB_UID and GID=NB_GID
RUN useradd --no-log-init --create-home --shell /bin/bash --uid "${NB_UID}" --gid "${NB_GID}" "${NB_USER}"
COPY run.sh /tapis/run.sh
RUN chmod +x /tapis/run.sh
USER ${NB_UID}
# Setup work directory
RUN mkdir "${NB_HOME}/work"
WORKDIR "${NB_HOME}"
ENTRYPOINT [ "/tapis/run.sh" ]