Sign inSign up

awokeknowing/php7-mysql

By awokeknowing

Updated over 8 years ago

php7-apache with mysqli, pdo, extensions and mod_rewrite enabled for hooking to official mysql image

Image
1

1.0K

awokeknowing/php7-mysql repository overview

The official php images used to come with many common extensions installed. Now they took them out and want you to install the ones you need as the docker image is built. This is just official php7-apache with gd, mcrypt, mysql, pdo, extensions, and also it enables mod_rewrite. With this, you can easily serve your current folder like:

docker run -d --name myapp -p 9256:80 -v "$(pwd)":/var/www/html awokeknowing/php7-mysql

And you can hook easily to official mysql images with --link (see mysql docker docs)

--------Dockerfile--------

FROM php:7.0-apache
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng-dev \
    && docker-php-ext-install -j$(nproc) iconv mcrypt \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd mbstring mysqli pdo pdo_mysql
RUN cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

# To build: docker build -t awokeknowing/php7-mysql:latest -t awokeknowing/php7-mysql:1.0 .
# To run:   docker run -d --name myapp -p 9256:80 -v "$(pwd)":/var/www/html awokeknowing/php7-mysql

Tag summary

Content type

Image

Digest

Size

169.5 MB

Last updated

over 8 years ago

docker pull awokeknowing/php7-mysql