From f3a016aa796f69d70595a8fe5375a30fe5af5ec8 Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Thu, 25 May 2017 16:44:51 +0800 Subject: [PATCH] adminer support mssql --- adminer/Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 5 ++++- env-example | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/adminer/Dockerfile b/adminer/Dockerfile index 6117454f..818c8e13 100644 --- a/adminer/Dockerfile +++ b/adminer/Dockerfile @@ -8,5 +8,22 @@ MAINTAINER Patrick Artounian # Add volume for sessions to allow session persistence VOLUME /sessions +##################################### +# SQL SERVER: +##################################### +USER root +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + set -xe \ + && apk --update add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc unixodbc-dev \ + && pecl channel-update pecl.php.net \ + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && echo "extension=sqlsrv.so" > /usr/local/etc/php/conf.d/20-sqlsrv.ini \ + && echo "extension=pdo_sqlsrv.so" > /usr/local/etc/php/conf.d/20-pdo_sqlsrv.ini \ +;fi + +USER adminer + # We expose Adminer on port 8080 (Adminer's default) EXPOSE 8080 diff --git a/docker-compose.yml b/docker-compose.yml index c79ba6aa..f05663c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -440,7 +440,10 @@ services: ### Adminer Container #################################### adminer: - build: ./adminer + build: + context: ./adminer + args: + - INSTALL_MSSQL=${ADM_INSTALL_MSSQL} ports: - "${ADM_PORT}:8080" depends_on: diff --git a/env-example b/env-example index a1fa108d..7ec7e921 100644 --- a/env-example +++ b/env-example @@ -161,6 +161,7 @@ MINIO_PORT=9000 ### ADMINER ############################################################################################################ ADM_PORT=8080 +ADM_INSTALL_MSSQL=false ### PHP MY ADMIN #######################################################################################################