chore: update Dockerfile

This commit is contained in:
XuehaiPan 2021-07-08 15:59:39 +08:00
parent 118cbfed28
commit cdf811b60d

View file

@ -2,22 +2,23 @@ FROM nvidia/driver:418.87.01-ubuntu18.04
ENV DEBIAN_FRONTEND=noninteractive
# Update APT sources
RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic main universe" > /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic-updates main universe" >> /etc/apt/sources.list && \
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic-security main universe" >> /etc/apt/sources.list && \
usermod -o -u 0 -g 0 _apt
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic-security main universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -yq python3 python3-pip
RUN apt-get clean autoclean
RUN apt-get autoremove --yes
RUN rm -rf /var/lib/{apt,dpkg,cache,log}
# Install Python 3
RUN apt-get update && \
apt-get install --quiet --yes --no-install-recommends \
python3-dev python3-pip python3-setuptools python3-wheel locales && \
rm -rf /var/lib/{apt,dpkg,cache,log}
# Install nvitop
COPY . /nvitop
WORKDIR /nvitop
RUN pip3 install .
RUN pip3 install --compile .
RUN rm -rf /root/.cache
# Entrypoint
ENV LC_ALL C.UTF-8
ENTRYPOINT [ "python3", "nvitop.py" ]