Overview
Debian-based images provide a full-featured environment with extensive package availability and comprehensive tooling. These images are ideal for development environments and production applications that require a wide range of system utilities.
Debian images are larger than Alpine variants but offer broader compatibility and more pre-installed tools.
PHP 8.4
PHP 8.3
PHP 8.2
PHP 8.1
namoshek/php-mssql:8.4-cli
namoshek/php-mssql:8.4-fpm
namoshek/php-mssql:8.3-cli
namoshek/php-mssql:8.3-fpm
namoshek/php-mssql:8.2-cli
namoshek/php-mssql:8.2-fpm
namoshek/php-mssql:8.1-cli
namoshek/php-mssql:8.1-fpm
What’s Included
Base System
Built on official PHP Docker images with Debian base:
Microsoft SQL Server Components
All Debian images include:
msodbcsql18 - Microsoft ODBC Driver 18 for SQL Server
mssql-tools18 - Command-line tools (sqlcmd and bcp)
unixodbc-dev - ODBC development headers
# Install MS SQL Server prerequisites
RUN curl -sSL -O https://packages.microsoft.com/config/debian/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2 | cut -d '.' -f 1)/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev \
&& rm -rf /var/lib/apt/lists/*
PHP Extensions
All images include these pre-installed PHP extensions:
bcmath Arbitrary precision mathematics
ds Efficient data structures
exif Read EXIF metadata from images
gd Image processing library
intl Internationalization functions
opcache Opcode caching for performance
pcntl Process control functions
pcov Code coverage driver (CLI only)
pdo_sqlsrv PDO driver for SQL Server
redis Redis client extension
sqlsrv Native SQL Server driver
CLI images include additional development utilities:
# Composer is pre-installed and ready to use
composer --version
# Node.js 22.x (PHP 8.4) or 20.x (PHP 8.1-8.3)
node --version
npm --version
# Yarn package manager
yarn --version
System Utilities
Common utilities included:
apt-transport-https - HTTPS support for APT
curl - Command-line HTTP client
gnupg2 - GNU Privacy Guard
nano - Text editor
unzip - Archive extraction
Complete Dockerfile
FROM php:8.4-cli
ENV ACCEPT_EULA=Y
# Install prerequisites required for tools and extensions
RUN apt-get update \
&& apt-get install -y apt-transport-https curl gnupg2 libpng-dev libzip-dev nano unzip \
&& rm -rf /var/lib/apt/lists/*
# Install prerequisites for the sqlsrv and pdo_sqlsrv PHP extensions
RUN curl -sSL -O https://packages.microsoft.com/config/debian/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2 | cut -d '.' -f 1)/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev \
&& rm -rf /var/lib/apt/lists/*
# Retrieve the script used to install PHP extensions
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/install-php-extensions
# Install required PHP extensions
RUN chmod uga+x /usr/bin/install-php-extensions \
&& sync \
&& install-php-extensions bcmath ds exif gd intl opcache pcntl pcov pdo_sqlsrv redis sqlsrv zip
# Download composer and mark it as executable
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer-stable.phar \
&& chmod +x /usr/local/bin/composer
# Download and install nodejs as well as yarn
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt-get update \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn
# Set the working directory
WORKDIR /var/www
FROM php:8.4-fpm
ENV ACCEPT_EULA=Y
# Install prerequisites required for tools and extensions
RUN apt-get update \
&& apt-get install -y apt-transport-https curl gnupg2 libpng-dev libzip-dev nano unzip \
&& rm -rf /var/lib/apt/lists/*
# Install prerequisites for the sqlsrv and pdo_sqlsrv PHP extensions
RUN curl -sSL -O https://packages.microsoft.com/config/debian/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2 | cut -d '.' -f 1)/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev \
&& rm -rf /var/lib/apt/lists/*
# Retrieve the script used to install PHP extensions
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/install-php-extensions
# Install required PHP extensions
RUN chmod uga+x /usr/bin/install-php-extensions \
&& sync \
&& install-php-extensions bcmath ds exif gd intl opcache pcntl pdo_sqlsrv redis sqlsrv zip
# Set the working directory
WORKDIR /var/www
Image Size
Debian images are larger due to the comprehensive system:
CLI images : ~600-700 MB
FPM images : ~500-600 MB
If image size is a critical concern for your deployment, consider using Alpine images instead.
When to Use Debian Images
Development Ideal for local development environments with full tooling support
Compatibility Better compatibility with packages requiring glibc instead of musl
Debugging More utilities available for troubleshooting and debugging
Complex Apps Applications with many dependencies that may not work well on Alpine
Usage Examples
Docker Run
Docker Compose
Custom Dockerfile
docker run -it namoshek/php-mssql:8.4-cli php -v
Comparison with Alpine
Feature Debian Alpine Base size Larger (~200MB) Smaller (~50MB) C library glibc musl libc Package manager apt apk Compatibility Excellent Good Development tools Included (CLI) Included (CLI) Best for Development, compatibility Production, minimal size
Next Steps
Alpine Images Explore lightweight Alpine Linux variants
Swoole Images High-performance asynchronous PHP images
Usage Guide Learn how to use these images effectively
PHP Extensions Complete list of available extensions