Skip to main content

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.

Available Tags

  • namoshek/php-mssql:8.4-cli
  • namoshek/php-mssql:8.4-fpm

What’s Included

Base System

Built on official PHP Docker images with Debian base:
FROM php:8.4-cli

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

zip

ZIP archive handling

Development Tools (CLI Images Only)

CLI images include additional development utilities:
# Composer is pre-installed and ready to use
composer --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

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 -it namoshek/php-mssql:8.4-cli php -v

Comparison with Alpine

FeatureDebianAlpine
Base sizeLarger (~200MB)Smaller (~50MB)
C libraryglibcmusl libc
Package manageraptapk
CompatibilityExcellentGood
Development toolsIncluded (CLI)Included (CLI)
Best forDevelopment, compatibilityProduction, 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

Build docs developers (and LLMs) love