Sign inSign up

alvar0rm/laravel

By alvar0rm

•Updated 3 days ago

Image designed to work with the Laravel framework based on PHP and Apache.

Image
Languages & frameworks
Web servers
0

50K+

alvar0rm/laravel repository overview

Esta documentación está traducida al inglés al final.

⁠¿Qué es esta imagen?

Imagen Docker preconfigurada para el ecosistema Laravel (versiones 5.0 a 13), con compatibilidad estricta entre PHP, Composer y Node.js LTS de cada era.

IMPORTANTE: Sin motor de base de datos embebido. Solo para desarrollo y pruebas, no usar en producción.


⁠Advertencias de Seguridad

Todas las imágenes usan Ubuntu 24.04 LTS. Estas versiones de PHP están EOL: solo para desarrollo local, nunca exponer a internet.

PHPEOL PHPOrigen de PHPParche PHP2Shell
5.6Dic 2018PPA ondrej/phpBackport del PPA
7.0Dic 2019PPA ondrej/phpBackport del PPA
7.1Dic 2019PPA ondrej/phpBackport del PPA
7.2Nov 2020PPA ondrej/phpBackport del PPA
7.3Dic 2021PPA ondrej/phpBackport del PPA
7.4Nov 2022PPA ondrej/phpBackport del PPA
8.0Nov 2023PPA ondrej/phpBackport del PPA
8.1Dic 2024PPA ondrej/phpBackport del PPA
8.2Dic 2025PPA ondrej/phpParche oficial (8.2.35)

Node.js 10, 12, 14 y 16 también están fuera de soporte.

⁠Parche de PHP2Shell (CVE-2026-109618 y CVE-2026-109619)

Las imágenes publicadas desde octubre de 2026 incluyen la corrección: PHP 5.6–8.1 con backport del PPA, 8.2 con 8.2.35, 8.3 con el paquete nativo de Ubuntu (8.3.6, parchado por Canonical), 8.4 con 8.4.27 y 8.5 con 8.5.12. Cada Dockerfile verifica el parche al compilar y falla si el changelog de PHP no menciona CVE-2026-109618.

php -v no indica si hay parche (el número de versión no cambia en backports). Para comprobarlo:

docker run --rm --entrypoint sh alvar0rm/laravel:7-php7.4 \
  -c 'zcat /usr/share/doc/php7.4-common/changelog.Debian.gz | grep CVE-2026-109618'

CVE-2026-115560 (anunciado el 23 de octubre de 2026): mitigación session.upload_progress.enabled=0. Estas imágenes no la aplican; PHP la trae activada por defecto.


⁠Cómo usar esta imagen

⁠Docker Compose (Recomendado)
services:
  app:
    image: alvar0rm/laravel:13-php8.4
    restart: unless-stopped
    volumes:
      - ./app:/var/www/app
    ports:
      - "80:80"
      - "5173:5173"

Si /var/www/app está vacío, el entrypoint copia automáticamente un proyecto Laravel base.

⁠Consola
docker run -d -p 80:80 \
  -v $(pwd)/app:/var/www/app \
  alvar0rm/laravel:13-php8.4-supervisor
⁠Como imagen base
FROM alvar0rm/laravel:13-php8.4
RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/*

⁠Variables de Entorno

VariableDescripciónDefault
TZZona horaria (ej: America/Mexico_City)UTC
GIT_USER_NAMENombre para GitDocker User
GIT_USER_EMAILEmail para Git[email protected]
GIT_DEFAULT_BRANCHRama por defectomaster
GIT_EDITOREditor Git-
GIT_PULL_REBASEEstrategia de pull-
GIT_HTTP_PROXYProxy HTTP para Git-
GIT_HTTPS_PROXYProxy HTTPS para Git-
GIT_COLOR_UIColores en Git-
GIT_CREDENTIAL_HELPERCredential helper-
GIT_SAFE_DIRECTORYSafe directory/var/www/app
GIT_ALIASESAlias personalizados-
GIT_CLONE_URLURL del repo a clonar-
GIT_CLONE_BRANCHRama a clonar-
GIT_CLONE_DEPTHProfundidad (shallow)-
GIT_POST_CLONE_COMMANDSComandos post-clonación-

Si GIT_CLONE_URL está definido y la carpeta está vacía, clona el repo automáticamente.

environment:
  TZ: "America/Mexico_City"
  GIT_USER_NAME: "Docker user"
  GIT_DEFAULT_BRANCH: "main"
  GIT_CLONE_URL: "https://github.com/usuario/proyecto.git"

Alias predefinidos: git s (status) · git lg (log)


⁠Matriz de Compatibilidad

Nomenclatura: {laravel}-php{version}[-supervisor] · Base: Ubuntu 24.04 LTS

LaravelPHPTags de ejemplo
5.0–5.15.65-php5.6, 5.1-php5.6-supervisor
5.2–5.45.6 / 7.0 / 7.1 / 7.25.2-php7.0, 5.4-php7.2-supervisor
5.57.0 / 7.1 / 7.2 / 7.3 / 7.45.5-php7.0, 5.5-php7.4-supervisor
5.6–5.87.1 / 7.2 / 7.3 / 7.45.6-php7.2, 5.8-php7.4-supervisor
6–77.2 / 7.3 / 7.4 / 8.06-php7.4, 7-php8.0-supervisor
87.3 / 7.4 / 8.0 / 8.18-php7.4, 8-php8.1-supervisor
98.0 / 8.1 / 8.29-php8.0, 9-php8.2-supervisor
108.1 / 8.2 / 8.310-php8.1, 10-php8.3-supervisor
118.2 / 8.3 / 8.411-php8.2, 11-php8.4-supervisor
128.2 / 8.3 / 8.412-php8.3, 12-php8.4-supervisor
138.3 / 8.4 / 8.513-php8.3, 13-php8.5 (8.5 sin variante -supervisor)
⁠Arquitecturas
PHPamd64arm64Motivo
5.6✅✅—
7.0–7.3✅❌Usan ODBC 17, no publicado para arm64 en Ubuntu 24.04
7.4–8.5✅✅—
⁠Composer (por versión de PHP)
PHPComposer
5.6–8.02.2.27
8.12.3.10
8.22.6.6
8.32.7.9
8.4–8.52.8.5
⁠Node.js
LaravelNode.jsYarnpnpmBun
5.010.24.1❌❌❌
5.1–5.410.24.11.x (Classic)❌❌
5.5–5.812.22.121.x (Classic)❌❌
6–714.21.31.x (Classic)❌❌
8–916.20.21.x (Classic)8.x❌
1018.20.84.x (corepack)10.x1.x
1120.18.34.x (corepack)10.x1.x
12–1322.14.04.x (corepack)11.x1.x
⁠Supervisor
Base OSSupervisor
Ubuntu 24.04 LTS4.2.x (4.2.5)

⁠Extensiones de PHP

ExtensiónPHP 5.6PHP 7.xPHP 8.x
bcmath, gd, intl, opcache, zip✅✅✅
pdo_mysql, pdo_pgsql, pdo_sqlite✅✅✅
mbstring, curl, xml, readline✅✅✅
mcryptLaravel 5.0–5.27.0 y 7.1 (Laravel 5.2)❌
pdo_dblib (FreeTDS)✅❌❌
pdo_sqlsrv (SQL Server)❌✅✅
redis✅✅✅
imagick✅✅✅

Conexión a SQL Server: PHP 5.6 usa pdo_dblib (FreeTDS). PHP 7.0–7.3 usa pdo_sqlsrv con ODBC Driver 17 (pdo_sqlsrv 5.3.0 en 7.0–7.2 y 5.9.0 en 7.3). PHP 7.4–8.5 usa pdo_sqlsrv con ODBC Driver 18 (5.10.1 en 7.4, 5.11.1 en 8.0–8.2, 5.12.0 en 8.3 y 5.13.3 en 8.4–8.5). Microsoft solo soporta ODBC 18 con pdo_sqlsrv 5.10 o superior. En PHP 8.5, OPcache viene integrado en el núcleo.

⁠Configuración de Apache

  • DocumentRoot: /var/www/app/public
  • Config: /etc/apache2/apache2.conf
  • VirtualHost HTTP: /etc/apache2/sites-available/000-default.conf
  • VirtualHost HTTPS: /etc/apache2/sites-available/default-ssl.conf

⁠Configuración de PHP (php.ini)

DirectivaValor
memory_limit512M
max_execution_time3600
max_input_time3600
post_max_size2G
upload_max_filesize2G
max_file_uploads20
display_errorsOff
log_errorsOn
expose_phpOff
session.use_strict_mode1

⁠Supervisor y Colas

Las imágenes con -supervisor incluyen Supervisor preconfigurado con un worker de ejemplo.

Directorios de configuración:

  • /etc/supervisor/conf.d/
  • /var/www/app/storage/supervisor/
[program:queue-default]
command=php /var/www/app/artisan queue:listen --timeout=3600 --tries=1
autostart=true
autorestart=true
numprocs=1
user=www-data
stdout_logfile=/var/www/app/storage/logs/default.log
ComandoDescripción
supervisorctl rereadRecargar configuración
supervisorctl updateAplicar cambios
supervisorctl start <prog>Iniciar programa
supervisorctl statusVer estado

⁠SSL

El entrypoint habilita HTTPS automáticamente si detecta certificados en:

  • /etc/ssl/certs/localhost.crt
  • /etc/ssl/private/localhost.key
volumes:
  - ./certs/localhost.crt:/etc/ssl/certs/localhost.crt:ro
  - ./certs/localhost.key:/etc/ssl/private/localhost.key:ro

⁠Configuración SSH para Git

services:
  app:
    image: alvar0rm/laravel:13-php8.4
    environment:
      GIT_CLONE_URL: "[email protected]:usuario/repositorio.git"
      SSH_AUTH_SOCK: "/tmp/ssh-agent.sock"
    volumes:
      - ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro             # Clonado inicial
      - ${SSH_AUTH_SOCK}:/tmp/ssh-agent.sock:ro          # Push/pull posteriores
      - ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro     # Verificación de host
MontajePropósito
id_rsaClonado inicial del repositorio
ssh-agent.sockPush/pull posteriores sin passphrase
known_hostsEvita errores de verificación de host

Llave sin passphrase (alternativa):

ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_docker -N "" -C "docker-dev"

Problemas comunes:

ErrorSolución
Permission denied (publickey)ssh-add ~/.ssh/id_rsa o verificar el volumen
Host key verification failedssh-keyscan github.com >> ~/.ssh/known_hosts
unsupported option "accept-new"Automático — el entrypoint detecta la versión de OpenSSH

Compatibilidad accept-new: todas las imágenes (PHP 5.6–8.5) usan Ubuntu 24.04 con OpenSSH 9.6, que soporta accept-new.



⁠What is this image?

Pre-configured Docker image for the Laravel ecosystem (versions 5.0 to 13), with strict compatibility between PHP, Composer, and the LTS Node.js of each era.

IMPORTANT: No embedded database engine. For development and testing only — do not use in production.


⁠Security Warnings

All images use Ubuntu 24.04 LTS. These PHP versions are EOL: local development only — never expose to the internet.

PHPPHP EOLPHP sourcePHP2Shell patch
5.6Dec 2018PPA ondrej/phpPPA backport
7.0Dec 2019PPA ondrej/phpPPA backport
7.1Dec 2019PPA ondrej/phpPPA backport
7.2Nov 2020PPA ondrej/phpPPA backport
7.3Dec 2021PPA ondrej/phpPPA backport
7.4Nov 2022PPA ondrej/phpPPA backport
8.0Nov 2023PPA ondrej/phpPPA backport
8.1Dec 2024PPA ondrej/phpPPA backport
8.2Dec 2025PPA ondrej/phpOfficial patch (8.2.35)

Node.js 10, 12, 14 and 16 are also out of support.

⁠PHP2Shell patch (CVE-2026-109618 and CVE-2026-109619)

Images published from October 2026 include the fix: PHP 5.6–8.1 with a PPA backport, 8.2 with 8.2.35, 8.3 with the native Ubuntu package (8.3.6, patched by Canonical), 8.4 with 8.4.27 and 8.5 with 8.5.12. Every Dockerfile verifies the patch at build time and fails if the PHP changelog does not mention CVE-2026-109618.

php -v does not tell you whether the patch is present (backports keep the version number). To check:

docker run --rm --entrypoint sh alvar0rm/laravel:7-php7.4 \
  -c 'zcat /usr/share/doc/php7.4-common/changelog.Debian.gz | grep CVE-2026-109618'

CVE-2026-115560 (announced October 23, 2026): mitigation is session.upload_progress.enabled=0. These images do not apply it; PHP enables it by default.


⁠How to use this image

services:
  app:
    image: alvar0rm/laravel:13-php8.4
    restart: unless-stopped
    volumes:
      - ./app:/var/www/app
    ports:
      - "80:80"
      - "5173:5173"

If /var/www/app is empty, the entrypoint automatically copies a base Laravel project.

⁠Console
docker run -d -p 80:80 \
  -v $(pwd)/app:/var/www/app \
  alvar0rm/laravel:13-php8.4-supervisor
⁠As base image
FROM alvar0rm/laravel:13-php8.4
RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/*

⁠Environment Variables

VariableDescriptionDefault
TZTimezone (e.g. America/New_York)UTC
GIT_USER_NAMEGit user nameDocker User
GIT_USER_EMAILGit user email[email protected]
GIT_DEFAULT_BRANCHDefault branchmaster
GIT_EDITORGit editor-
GIT_PULL_REBASEPull strategy-
GIT_HTTP_PROXYHTTP proxy for Git-
GIT_HTTPS_PROXYHTTPS proxy for Git-
GIT_COLOR_UIGit colors-
GIT_CREDENTIAL_HELPERCredential helper-
GIT_SAFE_DIRECTORYSafe directory/var/www/app
GIT_ALIASESCustom aliases-
GIT_CLONE_URLRepo URL to clone-
GIT_CLONE_BRANCHBranch to clone-
GIT_CLONE_DEPTHDepth (shallow clone)-
GIT_POST_CLONE_COMMANDSPost-clone commands-

If GIT_CLONE_URL is set and the folder is empty, the repo is cloned automatically.

environment:
  TZ: "America/New_York"
  GIT_USER_NAME: "Docker user"
  GIT_DEFAULT_BRANCH: "main"
  GIT_CLONE_URL: "https://github.com/user/project.git"

Predefined aliases: git s (status) · git lg (log)


⁠Compatibility Matrix

Naming convention: {laravel}-php{version}[-supervisor] · Base: Ubuntu 24.04 LTS

LaravelPHPExample Tags
5.0–5.15.65-php5.6, 5.1-php5.6-supervisor
5.2–5.45.6 / 7.0 / 7.1 / 7.25.2-php7.0, 5.4-php7.2-supervisor
5.57.0 / 7.1 / 7.2 / 7.3 / 7.45.5-php7.0, 5.5-php7.4-supervisor
5.6–5.87.1 / 7.2 / 7.3 / 7.45.6-php7.2, 5.8-php7.4-supervisor
6–77.2 / 7.3 / 7.4 / 8.06-php7.4, 7-php8.0-supervisor
87.3 / 7.4 / 8.0 / 8.18-php7.4, 8-php8.1-supervisor
98.0 / 8.1 / 8.29-php8.0, 9-php8.2-supervisor
108.1 / 8.2 / 8.310-php8.1, 10-php8.3-supervisor
118.2 / 8.3 / 8.411-php8.2, 11-php8.4-supervisor
128.2 / 8.3 / 8.412-php8.3, 12-php8.4-supervisor
138.3 / 8.4 / 8.513-php8.3, 13-php8.5 (8.5 has no -supervisor variant)
⁠Architectures
PHPamd64arm64Reason
5.6✅✅—
7.0–7.3✅❌They use ODBC 17, not published for arm64 on Ubuntu 24.04
7.4–8.5✅✅—
⁠Composer (by PHP version)
PHPComposer
5.6–8.02.2.27
8.12.3.10
8.22.6.6
8.32.7.9
8.4–8.52.8.5
⁠Node.js
LaravelNode.jsYarnpnpmBun
5.010.24.1❌❌❌
5.1–5.410.24.11.x (Classic)❌❌
5.5–5.812.22.121.x (Classic)❌❌
6–714.21.31.x (Classic)❌❌
8–916.20.21.x (Classic)8.x❌
1018.20.84.x (corepack)10.x1.x
1120.18.34.x (corepack)10.x1.x
12–1322.14.04.x (corepack)11.x1.x
⁠Supervisor
Base OSSupervisor
Ubuntu 24.04 LTS4.2.x (4.2.5)

⁠PHP Extensions

ExtensionPHP 5.6PHP 7.xPHP 8.x
bcmath, gd, intl, opcache, zip✅✅✅
pdo_mysql, pdo_pgsql, pdo_sqlite✅✅✅
mbstring, curl, xml, readline✅✅✅
mcryptLaravel 5.0–5.27.0 and 7.1 (Laravel 5.2)❌
pdo_dblib (FreeTDS)✅❌❌
pdo_sqlsrv (SQL Server)❌✅✅
redis✅✅✅
imagick✅✅✅

SQL Server connectivity: PHP 5.6 uses pdo_dblib (FreeTDS). PHP 7.0–7.3 uses pdo_sqlsrv with ODBC Driver 17 (pdo_sqlsrv 5.3.0 on 7.0–7.2 and 5.9.0 on 7.3). PHP 7.4–8.5 uses pdo_sqlsrv with ODBC Driver 18 (5.10.1 on 7.4, 5.11.1 on 8.0–8.2, 5.12.0 on 8.3 and 5.13.3 on 8.4–8.5). Microsoft only supports ODBC 18 with pdo_sqlsrv 5.10 or later. In PHP 8.5, OPcache is built into the core.

⁠Apache Configuration

  • DocumentRoot: /var/www/app/public
  • Config: /etc/apache2/apache2.conf
  • HTTP VirtualHost: /etc/apache2/sites-available/000-default.conf
  • HTTPS VirtualHost: /etc/apache2/sites-available/default-ssl.conf

⁠PHP Configuration (php.ini)

DirectiveValue
memory_limit512M
max_execution_time3600
max_input_time3600
post_max_size2G
upload_max_filesize2G
max_file_uploads20
display_errorsOff
log_errorsOn
expose_phpOff
session.use_strict_mode1

⁠Supervisor and Queues

Images with -supervisor include Supervisor pre-configured with an example queue worker.

Configuration directories:

  • /etc/supervisor/conf.d/
  • /var/www/app/storage/supervisor/
[program:queue-default]
command=php /var/www/app/artisan queue:listen --timeout=3600 --tries=1
autostart=true
autorestart=true
numprocs=1
user=www-data
stdout_logfile=/var/www/app/storage/logs/default.log
CommandDescription
supervisorctl rereadReload configuration
supervisorctl updateApply changes
supervisorctl start <prog>Start program
supervisorctl statusShow status

⁠SSL

The entrypoint auto-enables HTTPS if it detects certificates at:

  • /etc/ssl/certs/localhost.crt
  • /etc/ssl/private/localhost.key
volumes:
  - ./certs/localhost.crt:/etc/ssl/certs/localhost.crt:ro
  - ./certs/localhost.key:/etc/ssl/private/localhost.key:ro

⁠SSH Configuration for Git

services:
  app:
    image: alvar0rm/laravel:13-php8.4
    environment:
      GIT_CLONE_URL: "[email protected]:user/repository.git"
      SSH_AUTH_SOCK: "/tmp/ssh-agent.sock"
    volumes:
      - ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro             # Initial clone
      - ${SSH_AUTH_SOCK}:/tmp/ssh-agent.sock:ro          # Subsequent push/pull
      - ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro     # Host verification
MountPurpose
id_rsaInitial repository clone
ssh-agent.sockSubsequent push/pull without passphrase
known_hostsPrevents host verification errors

Key without passphrase (alternative):

ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_docker -N "" -C "docker-dev"

Common issues:

ErrorSolution
Permission denied (publickey)ssh-add ~/.ssh/id_rsa or check the volume mount
Host key verification failedssh-keyscan github.com >> ~/.ssh/known_hosts
unsupported option "accept-new"Automatic — entrypoint detects OpenSSH version

accept-new compatibility: all images (PHP 5.6–8.5) use Ubuntu 24.04 with OpenSSH 9.6, which supports accept-new.

Tag summary

Content type

Image

Digest

sha256:ec14a6ed6…

Size

405.8 MB

Last updated

3 days ago

docker pull alvar0rm/laravel:13-php8.5