Dockerfile2 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #-----------------------------------------------------------------------------------------
  2. # Copyright (c) Microsoft Corporation. All rights reserved.
  3. # Licensed under the MIT License. See LICENSE in the project root for license information.
  4. #-----------------------------------------------------------------------------------------
  5. FROM python:3
  6. # Install pylint
  7. RUN pip install pylint
  8. # Configure apt
  9. ENV DEBIAN_FRONTEND=noninteractive
  10. RUN sed -i "s|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g" /etc/apt/sources.list
  11. RUN sed -i "s|http://security.debian.org|http://mirrors.aliyun.com|g" /etc/apt/sources.list
  12. RUN rm -Rf /var/lib/apt/lists/* && apt-get -y update
  13. RUN apt-get -y install --no-install-recommends apt-utils 2>&1
  14. # Install git, process tools, lsb-release (common in install instructions for CLIs)
  15. RUN apt-get -y install git procps lsb-release
  16. # Install any missing dependencies for enhanced language service
  17. RUN apt-get install -y libicu[0-9][0-9]
  18. RUN mkdir /workspace
  19. WORKDIR /workspace
  20. # Install Python dependencies from requirements.txt if it exists
  21. COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/
  22. RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi
  23. # Clean up
  24. RUN apt-get autoremove -y \
  25. && apt-get clean -y \
  26. && rm -rf /var/lib/apt/lists/*
  27. ENV DEBIAN_FRONTEND=dialog
  28. # Set the default shell to bash rather than sh
  29. ENV SHELL /bin/bash