Dockerfile2 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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 php:7-cli
  6. # Configure apt
  7. ENV DEBIAN_FRONTEND=noninteractive
  8. RUN sed -i "s|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g" /etc/apt/sources.list
  9. RUN sed -i "s|http://security.debian.org|http://mirrors.aliyun.com|g" /etc/apt/sources.list
  10. RUN rm -Rf /var/lib/apt/lists/* && apt-get -y update
  11. RUN apt-get -y install --no-install-recommends apt-utils 2>&1
  12. # Install xdebug
  13. RUN yes | pecl install xdebug \
  14. && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
  15. && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
  16. && echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini
  17. # Install git, process tools, lsb-release (common in install instructions for CLIs)
  18. RUN apt-get -y install git procps lsb-release
  19. # Clean up
  20. RUN apt-get autoremove -y \
  21. && apt-get clean -y \
  22. && rm -rf /var/lib/apt/lists/*
  23. ENV DEBIAN_FRONTEND=dialog
  24. # Set the default shell to bash rather than sh
  25. ENV SHELL /bin/bash