Dockerfile cuda 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # FROM carlasim/carla:0.9.13
  2. FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
  3. # CMD ['/bin/sh','-c','/bin/bash']
  4. # 添加环境变量
  5. # export XDG_RUNTIME_DIR=/usr/lib/
  6. # export RUNLEVEL=3
  7. ENV XDG_RUNTIME_DIR=/usr/lib/
  8. ENV RUNLEVEL=3
  9. USER root
  10. RUN rm /etc/apt/sources.list.d/cuda.list
  11. # RUN rm /etc/apt/sources.list.d/nvidia-ml.list
  12. RUN apt-key del 7fa2af80
  13. RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
  14. RUN apt-get update && apt-get install -y --no-install-recommends wget
  15. RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
  16. RUN dpkg -i cuda-keyring_1.0-1_all.deb
  17. # 设置清华源
  18. RUN apt-get update
  19. RUN apt-get install xdg-user-dirs
  20. RUN apt-get install nano sudo curl -y
  21. RUN apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev mesa-utils -y
  22. RUN apt-get install libxtst6 libxv1 libegl1-mesa -y
  23. RUN wget https://sourceforge.net/projects/virtualgl/files/3.0.1/virtualgl_3.0.1_amd64.deb
  24. RUN dpkg -i virtualgl_3.0.1_amd64.deb
  25. RUN apt-get update
  26. RUN apt-get -f install
  27. # 安装conda
  28. # yhyu13 : install additional packages
  29. # 设置apt的源为tsinghua镜像源
  30. RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
  31. RUN apt-get update && apt-get install -y curl wget
  32. # 安装conda
  33. RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
  34. && bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \
  35. && rm Miniconda3-latest-Linux-x86_64.sh
  36. RUN /opt/conda/bin/conda update -n base -c defaults conda
  37. RUN /opt/conda/bin/conda create -n py38 python=3.8.5 -y
  38. ENV PATH /opt/conda/envs/py38/bin:$PATH
  39. COPY requirements.txt requirements.txt
  40. RUN pip install -r requirements.txt
  41. USER carla
  42. # WORKDIR /home/vangogh/software/FuzzScene
  43. # COPY code/env/carla.yml /home/vangogh/software/FuzzScene/code/env/carla.yml
  44. # COPY code/env/dave.yml /home/vangogh/software/FuzzScene/code/env/dave.yml
  45. # RUN /opt/conda/bin/conda env create -f code/env/carla.yml
  46. # /opt/conda/bin/conda env create -f code/env/dave.yml
  47. COPY . .
  48. # CMD ["/home/carla/CarlaUE4.sh -opengl"]
  49. # CMD ["./CarlaUE4.sh","-opengl"]