retesere20

Untitled

May 20th, 2021
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FROM ubuntu:20.04
  2. # FROM debian:jessie
  3.  
  4. MAINTAINER Yo-An Lin "yoanlin93@gmail.com"
  5.  
  6. USER root
  7.  
  8. ENV DEBIAN_FRONTEND noninteractive
  9.  
  10. ENV PHP_VERSION 7.4
  11.  
  12. ENV PHP_SUBVERSION $PHP_VERSION.10
  13.  
  14. ENV PHPBREW_ROOT /root/.phpbrew
  15.  
  16. ENV PHPBREW_HOME /root/.phpbrew
  17.  
  18. ENV PHPBREW_PHP php-$PHP_VERSION.10
  19.  
  20. ENV PHPBREW_SET_PROMPT 1
  21.  
  22.  
  23. # Remove default dash and replace it with bash
  24. RUN rm /bin/sh && ln -s /bin/bash /bin/sh
  25.  
  26. RUN echo "Asia/Taipei" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
  27.  
  28. RUN perl -i.bak -pe "s/archive.ubuntu.com/g" /etc/apt/sources.list
  29.  
  30. RUN export DEBIAN_FRONTEND="noninteractive" \
  31. && apt-get update \
  32. && apt-get -qqy install git \
  33. && apt-get -qqy install wget \
  34. && apt-get -qqy install curl \
  35. && apt-get -qqy install ant ant-contrib sqlite3 \
  36. && apt-get clean -y \
  37. && apt-get autoclean -y \
  38. && apt-get autoremove -y \
  39. && rm -rf /var/lib/{apt,dpkg,cache,log}/ \
  40. && rm -rf /var/lib/apt/lists/*
  41.  
  42. # Install php tools
  43. RUN mkdir -p /usr/bin \
  44. && wget -q -O /usr/bin/composer https://getcomposer.org/composer.phar && chmod +x /usr/bin/composer \
  45. && wget -q -O /usr/bin/phpbrew https://github.com/phpbrew/phpbrew/raw/master/phpbrew && chmod +x /usr/bin/phpbrew
  46.  
  47.  
  48. RUN phpbrew init \
  49. && echo 'source $HOME/.phpbrew/bashrc' >> /root/.bashrc \
  50. && source ~/.phpbrew/bashrc \
  51. && phpbrew install $PHP_SUBVERSION \
  52. +default +bcmath +bz2 +calendar +cli +ctype +dom +fileinfo +filter +json \
  53. +mbregex +mbstring +mhash +pcntl +pcre +pdo +phar +posix +readline +sockets \
  54. +tokenizer +xml +curl +zip +openssl=yes +icu +opcache +fpm +sqlite +mysql +icu +default +intl +gettext
  55.  
  56. RUN phpbrew --debug install 7.4 +default +mysql +sqlite +mb +debug +fpm +intl +openssl=/usr/local/opt/openssl +bz2=/usr/local/opt/bzip2 +zlib=/usr/local/opt/zlib +apxs2=/usr/bin/apxs2 -- --enable-maintainer-zts
  57. RUN phpbrew ext install parallel -- --enable-parallel-coverage --enable-parallel-dev
  58.  
  59. # RUN echo "Asia/Taipei" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
  60.  
  61. COPY php.ini $PHPBREW_ROOT/php/php-$PHP_SUBVERSION/etc/php.ini
  62.  
  63. VOLUME /home/ubuntu
  64. WORKDIR /home/ubuntu
  65.  
  66. COPY build.sh /home/ubuntu/build.sh
  67. ENTRYPOINT ["/home/ubuntu/build.sh"]
  68.  
RAW Paste Data