Dockerfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from ubuntu:18.04
  2. # Install base libs
  3. run apt-get update && apt-get install --no-install-recommends -y libpng16-16=1.6.34-1ubuntu0.18.04.2 \
  4. libtiff5=4.0.9-5ubuntu0.3 libjpeg8=8c-2ubuntu8 build-essential=12.4ubuntu1 wget=1.19.4-1ubuntu2.2 git=1:2.17.1-1ubuntu0.7 \
  5. python3.6 python3.6-dev python3-pip libxerces-c-dev \
  6. && rm -rf /var/lib/apt/lists/*
  7. # Install python requirements
  8. run pip3 install --user setuptools==46.3.0 wheel==0.34.2 && pip3 install py_trees==0.8.3 networkx==2.2 pygame==1.9.6 \
  9. six==1.14.0 numpy==1.18.4 psutil==5.7.0 shapely==1.7.0 xmlschema==1.1.3 ephem==3.7.6.0 tabulate==0.8.7\
  10. && mkdir -p /app/scenario_runner
  11. # Install scenario_runner
  12. copy . /app/scenario_runner
  13. # setup environment :
  14. #
  15. # CARLA_HOST : uri for carla package without trailing slash.
  16. # For example, "https://carla-releases.s3.eu-west-3.amazonaws.com/Linux".
  17. # If this environment is not passed to docker build, the value
  18. # is taken from CARLA_VER file inside the repository.
  19. #
  20. # CARLA_RELEASE : Name of the package to be used. For example, "CARLA_0.9.9".
  21. # If this environment is not passed to docker build, the value
  22. # is taken from CARLA_VER file inside the repository.
  23. #
  24. #
  25. # It's expected that $(CARLA_HOST)/$(CARLA_RELEASE).tar.gz is a downloadable resource.
  26. #
  27. env CARLA_HOST ""
  28. env CARLA_RELEASE ""
  29. # Extract and install python API and resources from CARLA
  30. run export DEFAULT_CARLA_HOST="$(sed -e 's/^\s*HOST\s*=\s*//;t;d' /app/scenario_runner/CARLA_VER)" && \
  31. echo "$DEFAULT_CARLA_HOST" && \
  32. export CARLA_HOST="${CARLA_HOST:-$DEFAULT_CARLA_HOST}" && \
  33. export DEFAULT_CARLA_RELEASE="$(sed -e 's/^\s*RELEASE\s*=\s*//;t;d' /app/scenario_runner/CARLA_VER)" && \
  34. export CARLA_RELEASE="${CARLA_RELEASE:-$DEFAULT_CARLA_RELEASE}" && \
  35. echo "$CARLA_HOST/$CARLA_RELEASE.tar.gz" && \
  36. wget -qO- "$CARLA_HOST/$CARLA_RELEASE.tar.gz" | tar -xzv PythonAPI/carla -C / && \
  37. mv /PythonAPI/carla /app/ && \
  38. python3 -m easy_install --no-find-links --no-deps "$(find /app/carla/ -iname '*py3.*.egg' )"
  39. # Setup working environment
  40. workdir /app/scenario_runner
  41. env PYTHONPATH "${PYTHONPATH}:/app/carla/agents:/app/carla"
  42. entrypoint ["/bin/sh" ]