-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (33 loc) · 1002 Bytes
/
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
FROM pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
curl \
git \
libgl1-mesa-dev \
libglib2.0-0 \
libsndfile1 \
tar \
unzip \
vim \
keychain
# Copy files from host to the image.
COPY requirements.txt /tmp/requirements.txt
# Upgrade pip and install Python packages from requirements.txt.
RUN pip install --upgrade pip && \
pip install -r /tmp/requirements.txt
# Set the language settings.
ENV LANG=C.UTF-8
ENV LANGUAGE=en_US
# Create the user.
ARG USERNAME
ARG USER_UID
ARG USER_GID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y --no-install-recommends sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace