1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| ### Input variables ## ARG http_proxy ARG https_proxy ARG no_proxy
## put arg as env for futur use ENV http_proxy=$http_proxy ENV https_proxy=$https_proxy ENV no_proxy=$no_proxy
# System Env ENV TERM=xterm ENV LC_ALL=C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive
# Package Env ENV INSTALL="apt-utils software-properties-common vim dos2unix sqlite3 mysql-server mysql-client libpcre3-dev apache2 php-pear php-pecl-http maven" ENV INSTALL_PHP="5.5 5.6 7.0 7.2" ENV INSTALL_PHP_MODULES="xml mysql http mcrypt sqlite3 mbstring curl cli gd dev intl xsl memcache memcached zip apc" ENV INSTALL_JAVA="openjdk-8-jdk openjdk-8-jre" ENV INSTALL_NODEJS="8 9 10 11 12"
# Download others packages RUN apt-get update -y && apt-get install -y software-properties-common apt-transport-https lsb-release
# Download the signing key for php repo RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
# Add repo for php packages RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && apt-get update -y
# Add nvm for nodejs managing RUN wget -O install.sh https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh; bash install.sh
# Installing packages # System packages RUN /bin/bash -c 'for packages in ${INSTALL[@]};do apt-get install -y ${packages} ;done'
# Php & php modules packages RUN /bin/bash -c 'for php_version in ${INSTALL_PHP[@]};do apt-get install -y php${php_version} ; for php_modules in ${INSTALL_PHP_MODULES[@]};do apt-get install -y php${php_version}-${php_modules} ;done ;done'
# Java packages RUN /bin/bash -c 'for java_version in ${INSTALL_JAVA[@]};do apt-get install -y ${java_version} ;done'
# Nodejs packages RUN /bin/bash -c 'source ~/.profile 2>/dev/null; for node_version in ${INSTALL_NODEJS[@]};do nvm install ${node_version} ;done'
|