-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (37 loc) · 1.44 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
# syntax=docker/dockerfile:1.2
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
# add nvidia key
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub \
&& apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
# add libs
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
git \
build-essential \
openssh-server \
python3 \
python3-distutils \
python3-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /tmp/requirements.txt
RUN --mount=type=cache,mode=0755,target=/root/.cache pip install -r /tmp/requirements.txt \
&& rm /tmp/*
# create guest user
RUN mkdir /var/run/sshd
RUN useradd -m guest
RUN passwd -d guest
RUN sed -ri 's/^#?PermitEmptyPasswords\s+.*/PermitEmptyPasswords yes/' /etc/ssh/sshd_config
RUN sed -ri 's/^#?UsePAM\s+.*/UsePAM no/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
ENTRYPOINT ["/usr/sbin/sshd"]
# set up expose port
WORKDIR /root
COPY start.sh /root/
ARG PORT=2000
ENV PORT ${PORT}
EXPOSE ${PORT}
WORKDIR /workspace
CMD ["-D"]