docker file
2021-11-30 本文已影响0人
夜空最亮的9星
FROM python:3.7
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
WORKDIR /code
COPY . .
RUN apt-get update
RUN apt-get install vim ffmpeg libsm6 libxext6 cron openssh-server -y
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# 修改容器時間
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai'>/etc/timezone
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
RUN echo "root:123456" | chpasswd
RUN echo "alias ll='ls -l'" >> ~/.bash_profile
RUN /bin/bash -c 'source ~/.bash_profile;'
CMD ["python","app.py"]