|
FROM ubuntu:18.04 |
|
|
|
ARG DEBIAN_FRONTEND=noninteractive |
|
ARG DUMB_INIT_URL=https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 |
|
ARG DUMB_INIT_PATH=/usr/local/bin/dumb-init |
|
|
|
ARG USERNAME=php |
|
ARG USER_UID=1000 |
|
ARG USER_GID=$USER_UID |
|
|
|
ENV TZ=America/Sao_Paulo |
|
ENV TERM=xterm-256color |
|
|
|
SHELL [ "/bin/bash", "-c" ] |
|
|
|
ADD ${DUMB_INIT_URL} ${DUMB_INIT_PATH} |
|
|
|
RUN set -xeu; \ |
|
groupadd --gid $USER_GID $USERNAME; \ |
|
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME; \ |
|
apt-get update; \ |
|
apt-get install -y sudo; \ |
|
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME; \ |
|
chmod 0440 /etc/sudoers.d/$USERNAME; |
|
|
|
RUN set -xeu; \ |
|
apt-get -qq update; \ |
|
apt-get -qq install -y locales apt-utils nano; \ |
|
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen; \ |
|
dpkg-reconfigure --frontend=noninteractive locales; \ |
|
update-locale LANG=en_US.UTF-8; \ |
|
apt-get -qq clean; \ |
|
chmod +x ${DUMB_INIT_PATH}; |
|
|
|
ENV LANG=en_US.UTF-8 |
|
ENV LC_ALL=en_US.UTF-8 |
|
|
|
RUN set -xeu; \ |
|
apt-get -qq update; \ |
|
apt-get -qq install -y tzdata; \ |
|
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime; \ |
|
echo ${TZ} > /etc/timezone; \ |
|
dpkg-reconfigure --frontend=noninteractive tzdata; \ |
|
apt-get -qq clean; |
|
|
|
RUN set -xeu; \ |
|
apt-get -qq update; \ |
|
apt-get -qq install -y nano build-essential curl cmake g++ libpcre3-dev libssl-dev make openssl libgmp-dev git curl ca-certificates software-properties-common wget zip unzip > /dev/null; \ |
|
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php; \ |
|
apt-get -qq update; \ |
|
apt-get -qq install php7.1 php7.1-dev php7.1-xml php7.1-mbstring php7.1-curl php7.1-zip php7.1-xdebug; \ |
|
apt-get -qq clean; |
|
|
|
RUN set -xeu; \ |
|
curl -fsSL "https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb" -o /tmp/libuv1_1.35.0-1_amd64.deb; \ |
|
curl -fsSL "https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb" -o /tmp/libuv1-dev_1.35.0-1_amd64.deb; \ |
|
curl -fsSL "https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb" -o /tmp/cassandra-cpp-driver_2.16.0-1_amd64.deb; \ |
|
curl -fsSL "https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb" -o /tmp/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb; \ |
|
dpkg -i /tmp/libuv1_1.35.0-1_amd64.deb; \ |
|
dpkg -i /tmp/libuv1-dev_1.35.0-1_amd64.deb; \ |
|
dpkg -i /tmp/cassandra-cpp-driver_2.16.0-1_amd64.deb; \ |
|
dpkg -i /tmp/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb; |
|
|
|
RUN set -xeu; \ |
|
update-alternatives --set php /usr/bin/php7.1; \ |
|
update-alternatives --set phar /usr/bin/phar7.1; \ |
|
update-alternatives --set phar.phar /usr/bin/phar.phar7.1; \ |
|
pecl install cassandra > /dev/null; \ |
|
echo "extension=cassandra.so" | tee -a /etc/php/7.1/cli/conf.d/20-cassandra.ini; \ |
|
curl -fsSL "https://getcomposer.org/installer" | php -- --filename=composer --install-dir=/usr/local/bin; |
|
|
|
USER ${USERNAME} |
|
|
|
WORKDIR /var/www |
|
|
|
ENTRYPOINT [ "/usr/local/bin/dumb-init", "--" ] |
|
|
|
CMD [ "bash" ] |