Image designed to work with the Laravel framework based on PHP and Apache.
10K+
Esta documentación está traducida al inglés al final.
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.
Las siguientes versiones usan imágenes base EOL. Solo para desarrollo local, nunca exponer a internet.
| PHP | EOL PHP | Base OS | EOL OS |
|---|---|---|---|
| 5.6 | Dic 2018 | Debian 9 Stretch | Jun 2022 |
| 7.0 | Dic 2019 | Debian 9 Stretch | Jun 2022 |
| 7.1 | Dic 2019 | Debian 10 Buster | Jun 2024 |
| 7.2 | Nov 2020 | Debian 10 Buster | Jun 2024 |
| 7.3 | Dic 2021 | Debian 11 Bullseye | Jun 2026 |
| 7.4 | Nov 2022 | Debian 11 Bullseye | Jun 2026 |
| 8.0 | Nov 2023 | Ubuntu 24.04 LTS | Abr 2029 |
| 8.1 | Dic 2024 | Ubuntu 24.04 LTS | Abr 2029 |
| 8.2 | Dic 2025 | Ubuntu 24.04 LTS | Abr 2029 |
Node.js 10, 12, 14 y 16 también están fuera de soporte.
services:
app:
image: alvar0rm/laravel:13-php8.4
restart: unless-stopped
volumes:
- ./app:/var/www/app
ports:
- "80:80"
- "5173:5173"
Si
/var/www/appestá vacío, el entrypoint copia automáticamente un proyecto Laravel base.
docker run -d -p 80:80 \
-v $(pwd)/app:/var/www/app \
alvar0rm/laravel:13-php8.4-supervisor
FROM alvar0rm/laravel:13-php8.4
RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/*
| Variable | Descripción | Default |
|---|---|---|
TZ | Zona horaria (ej: America/Mexico_City) | UTC |
GIT_USER_NAME | Nombre para Git | Docker User |
GIT_USER_EMAIL | Email para Git | [email protected] |
GIT_DEFAULT_BRANCH | Rama por defecto | master |
GIT_EDITOR | Editor Git | - |
GIT_PULL_REBASE | Estrategia de pull | - |
GIT_HTTP_PROXY | Proxy HTTP para Git | - |
GIT_HTTPS_PROXY | Proxy HTTPS para Git | - |
GIT_COLOR_UI | Colores en Git | - |
GIT_CREDENTIAL_HELPER | Credential helper | - |
GIT_SAFE_DIRECTORY | Safe directory | /var/www/app |
GIT_ALIASES | Alias personalizados | - |
GIT_CLONE_URL | URL del repo a clonar | - |
GIT_CLONE_BRANCH | Rama a clonar | - |
GIT_CLONE_DEPTH | Profundidad (shallow) | - |
GIT_POST_CLONE_COMMANDS | Comandos 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)
Nomenclatura: {laravel}-php{version}[-supervisor]
| Laravel | PHP | Base OS | Tags de ejemplo |
|---|---|---|---|
| 5.0–5.1 | 5.6 | Debian 9 | 5-php5.6, 5.1-php5.6-supervisor |
| 5.2–5.4 | 5.6 / 7.0 / 7.1 / 7.2 | Debian 9–10 | 5.2-php7.0, 5.4-php7.2-supervisor |
| 5.5 | 7.0 / 7.1 / 7.2 / 7.3 / 7.4 | Debian 9–11 | 5.5-php7.0, 5.5-php7.4-supervisor |
| 5.6–5.8 | 7.1 / 7.2 / 7.3 / 7.4 | Debian 10–11 | 5.6-php7.2, 5.8-php7.4-supervisor |
| 6–7 | 7.2 / 7.3 / 7.4 / 8.0 | Debian 10–11 / Ubuntu 24.04 | 6-php7.4, 7-php8.0-supervisor |
| 8 | 7.3 / 7.4 / 8.0 / 8.1 | Debian 11 / Ubuntu 24.04 | 8-php7.4, 8-php8.1-supervisor |
| 9 | 8.0 / 8.1 / 8.2 | Ubuntu 24.04 | 9-php8.0, 9-php8.2-supervisor |
| 10 | 8.1 / 8.2 / 8.3 | Ubuntu 24.04 | 10-php8.1, 10-php8.3-supervisor |
| 11 | 8.2 / 8.3 / 8.4 | Ubuntu 24.04 | 11-php8.2, 11-php8.4-supervisor |
| 12 | 8.2 / 8.3 / 8.4 | Ubuntu 24.04 | 12-php8.3, 12-php8.4-supervisor |
| 13 | 8.3 / 8.4 | Ubuntu 24.04 | 13-php8.3, 13-php8.4-supervisor |
| PHP | Composer |
|---|---|
| 5.6–8.0 | 2.2.27 |
| 8.1 | 2.3.10 |
| 8.2 | 2.6.6 |
| 8.3 | 2.7.9 |
| 8.4 | 2.8.5 |
| Laravel | Node.js | Yarn | pnpm | Bun |
|---|---|---|---|---|
| 5.0 | 10.24.1 | ❌ | ❌ | ❌ |
| 5.1–5.4 | 10.24.1 | 1.x (Classic) | ❌ | ❌ |
| 5.5–5.8 | 12.22.12 | 1.x (Classic) | ❌ | ❌ |
| 6–7 | 14.21.3 | 1.x (Classic) | ❌ | ❌ |
| 8–9 | 16.20.2 | 1.x (Classic) | 8.x | ❌ |
| 10 | 18.20.8 | 4.x (corepack) | 10.x | 1.x |
| 11 | 20.18.3 | 4.x (corepack) | 10.x | 1.x |
| 12–13 | 22.14.0 | 4.x (corepack) | 11.x | 1.x |
| Base OS | Supervisor |
|---|---|
| Debian 9 Stretch | 3.3.x |
| Debian 10 Buster | 3.3.x |
| Debian 11 Bullseye | 4.2.x |
| Ubuntu 24.04 LTS | 4.2.x |
| Extensión | PHP 5.6 | PHP 7.x | PHP 8.x |
|---|---|---|---|
| bcmath, gd, intl, opcache, zip | ✅ | ✅ | ✅ |
| pdo_mysql, pdo_pgsql, pdo_sqlite | ✅ | ✅ | ✅ |
| mcrypt | ✅ | ❌ | ❌ |
| pdo_dblib (FreeTDS) | ✅ | ❌ | ❌ |
| pdo_sqlsrv (SQL Server) | ❌ | ✅ | ✅ |
| redis | ✅ | ✅ | ✅ |
| imagick | ✅ | ✅ | ✅ |
/var/www/app/public/etc/apache2/apache2.conf/etc/apache2/sites-available/000-default.conf/etc/apache2/sites-available/default-ssl.confphp.ini)| Directiva | Valor |
|---|---|
memory_limit | 512M |
max_execution_time | 3600 |
max_input_time | 3600 |
post_max_size | 2G |
upload_max_filesize | 2G |
max_file_uploads | 20 |
display_errors | Off |
log_errors | On |
expose_php | Off |
session.use_strict_mode | 1 |
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
| Comando | Descripción |
|---|---|
supervisorctl reread | Recargar configuración |
supervisorctl update | Aplicar cambios |
supervisorctl start <prog> | Iniciar programa |
supervisorctl status | Ver estado |
El entrypoint habilita HTTPS automáticamente si detecta certificados en:
/etc/ssl/certs/localhost.crt/etc/ssl/private/localhost.keyvolumes:
- ./certs/localhost.crt:/etc/ssl/certs/localhost.crt:ro
- ./certs/localhost.key:/etc/ssl/private/localhost.key:ro
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
| Montaje | Propósito |
|---|---|
id_rsa | Clonado inicial del repositorio |
ssh-agent.sock | Push/pull posteriores sin passphrase |
known_hosts | Evita 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:
| Error | Solución |
|---|---|
Permission denied (publickey) | ssh-add ~/.ssh/id_rsa o verificar el volumen |
Host key verification failed | ssh-keyscan github.com >> ~/.ssh/known_hosts |
unsupported option "accept-new" | Automático — el entrypoint detecta la versión de OpenSSH |
Compatibilidad accept-new por OS:
| OpenSSH | OS base | PHP afectado |
|---|---|---|
7.4 — no únicamente | Debian 9 Stretch | PHP 5.6, 7.0 |
7.9+ — accept-new ✅ | Debian 10–11 | PHP 7.1–7.4 |
9.6+ — accept-new ✅ | Ubuntu 24.04 | PHP 8.0–8.4 |
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.
The following versions use EOL base images. Local development only — never expose to the internet.
| PHP | PHP EOL | Base OS | OS EOL |
|---|---|---|---|
| 5.6 | Dec 2018 | Debian 9 Stretch | Jun 2022 |
| 7.0 | Dec 2019 | Debian 9 Stretch | Jun 2022 |
| 7.1 | Dec 2019 | Debian 10 Buster | Jun 2024 |
| 7.2 | Nov 2020 | Debian 10 Buster | Jun 2024 |
| 7.3 | Dec 2021 | Debian 11 Bullseye | Jun 2026 |
| 7.4 | Nov 2022 | Debian 11 Bullseye | Jun 2026 |
| 8.0 | Nov 2023 | Ubuntu 24.04 LTS | Apr 2029 |
| 8.1 | Dec 2024 | Ubuntu 24.04 LTS | Apr 2029 |
| 8.2 | Dec 2025 | Ubuntu 24.04 LTS | Apr 2029 |
Node.js 10, 12, 14 and 16 are also out of support.
services:
app:
image: alvar0rm/laravel:13-php8.4
restart: unless-stopped
volumes:
- ./app:/var/www/app
ports:
- "80:80"
- "5173:5173"
If
/var/www/appis empty, the entrypoint automatically copies a base Laravel project.
docker run -d -p 80:80 \
-v $(pwd)/app:/var/www/app \
alvar0rm/laravel:13-php8.4-supervisor
FROM alvar0rm/laravel:13-php8.4
RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/*
| Variable | Description | Default |
|---|---|---|
TZ | Timezone (e.g. America/New_York) | UTC |
GIT_USER_NAME | Git user name | Docker User |
GIT_USER_EMAIL | Git user email | [email protected] |
GIT_DEFAULT_BRANCH | Default branch | master |
GIT_EDITOR | Git editor | - |
GIT_PULL_REBASE | Pull strategy | - |
GIT_HTTP_PROXY | HTTP proxy for Git | - |
GIT_HTTPS_PROXY | HTTPS proxy for Git | - |
GIT_COLOR_UI | Git colors | - |
GIT_CREDENTIAL_HELPER | Credential helper | - |
GIT_SAFE_DIRECTORY | Safe directory | /var/www/app |
GIT_ALIASES | Custom aliases | - |
GIT_CLONE_URL | Repo URL to clone | - |
GIT_CLONE_BRANCH | Branch to clone | - |
GIT_CLONE_DEPTH | Depth (shallow clone) | - |
GIT_POST_CLONE_COMMANDS | Post-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)
Naming convention: {laravel}-php{version}[-supervisor]
| Laravel | PHP | Base OS | Example Tags |
|---|---|---|---|
| 5.0–5.1 | 5.6 | Debian 9 | 5-php5.6, 5.1-php5.6-supervisor |
| 5.2–5.4 | 5.6 / 7.0 / 7.1 / 7.2 | Debian 9–10 | 5.2-php7.0, 5.4-php7.2-supervisor |
| 5.5 | 7.0 / 7.1 / 7.2 / 7.3 / 7.4 | Debian 9–11 | 5.5-php7.0, 5.5-php7.4-supervisor |
| 5.6–5.8 | 7.1 / 7.2 / 7.3 / 7.4 | Debian 10–11 | 5.6-php7.2, 5.8-php7.4-supervisor |
| 6–7 | 7.2 / 7.3 / 7.4 / 8.0 | Debian 10–11 / Ubuntu 24.04 | 6-php7.4, 7-php8.0-supervisor |
| 8 | 7.3 / 7.4 / 8.0 / 8.1 | Debian 11 / Ubuntu 24.04 | 8-php7.4, 8-php8.1-supervisor |
| 9 | 8.0 / 8.1 / 8.2 | Ubuntu 24.04 | 9-php8.0, 9-php8.2-supervisor |
| 10 | 8.1 / 8.2 / 8.3 | Ubuntu 24.04 | 10-php8.1, 10-php8.3-supervisor |
| 11 | 8.2 / 8.3 / 8.4 | Ubuntu 24.04 | 11-php8.2, 11-php8.4-supervisor |
| 12 | 8.2 / 8.3 / 8.4 | Ubuntu 24.04 | 12-php8.3, 12-php8.4-supervisor |
| 13 | 8.3 / 8.4 | Ubuntu 24.04 | 13-php8.3, 13-php8.4-supervisor |
| PHP | Composer |
|---|---|
| 5.6–8.0 | 2.2.27 |
| 8.1 | 2.3.10 |
| 8.2 | 2.6.6 |
| 8.3 | 2.7.9 |
| 8.4 | 2.8.5 |
| Laravel | Node.js | Yarn | pnpm | Bun |
|---|---|---|---|---|
| 5.0 | 10.24.1 | ❌ | ❌ | ❌ |
| 5.1–5.4 | 10.24.1 | 1.x (Classic) | ❌ | ❌ |
| 5.5–5.8 | 12.22.12 | 1.x (Classic) | ❌ | ❌ |
| 6–7 | 14.21.3 | 1.x (Classic) | ❌ | ❌ |
| 8–9 | 16.20.2 | 1.x (Classic) | 8.x | ❌ |
| 10 | 18.20.8 | 4.x (corepack) | 10.x | 1.x |
| 11 | 20.18.3 | 4.x (corepack) | 10.x | 1.x |
| 12–13 | 22.14.0 | 4.x (corepack) | 11.x | 1.x |
| Base OS | Supervisor |
|---|---|
| Debian 9 Stretch | 3.3.x |
| Debian 10 Buster | 3.3.x |
| Debian 11 Bullseye | 4.2.x |
| Ubuntu 24.04 LTS | 4.2.x |
| Extension | PHP 5.6 | PHP 7.x | PHP 8.x |
|---|---|---|---|
| bcmath, gd, intl, opcache, zip | ✅ | ✅ | ✅ |
| pdo_mysql, pdo_pgsql, pdo_sqlite | ✅ | ✅ | ✅ |
| mcrypt | ✅ | ❌ | ❌ |
| pdo_dblib (FreeTDS) | ✅ | ❌ | ❌ |
| pdo_sqlsrv (SQL Server) | ❌ | ✅ | ✅ |
| redis | ✅ | ✅ | ✅ |
| imagick | ✅ | ✅ | ✅ |
/var/www/app/public/etc/apache2/apache2.conf/etc/apache2/sites-available/000-default.conf/etc/apache2/sites-available/default-ssl.confphp.ini)| Directive | Value |
|---|---|
memory_limit | 512M |
max_execution_time | 3600 |
max_input_time | 3600 |
post_max_size | 2G |
upload_max_filesize | 2G |
max_file_uploads | 20 |
display_errors | Off |
log_errors | On |
expose_php | Off |
session.use_strict_mode | 1 |
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
| Command | Description |
|---|---|
supervisorctl reread | Reload configuration |
supervisorctl update | Apply changes |
supervisorctl start <prog> | Start program |
supervisorctl status | Show status |
The entrypoint auto-enables HTTPS if it detects certificates at:
/etc/ssl/certs/localhost.crt/etc/ssl/private/localhost.keyvolumes:
- ./certs/localhost.crt:/etc/ssl/certs/localhost.crt:ro
- ./certs/localhost.key:/etc/ssl/private/localhost.key:ro
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
| Mount | Purpose |
|---|---|
id_rsa | Initial repository clone |
ssh-agent.sock | Subsequent push/pull without passphrase |
known_hosts | Prevents host verification errors |
Key without passphrase (alternative):
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_docker -N "" -C "docker-dev"
Common issues:
| Error | Solution |
|---|---|
Permission denied (publickey) | ssh-add ~/.ssh/id_rsa or check the volume mount |
Host key verification failed | ssh-keyscan github.com >> ~/.ssh/known_hosts |
unsupported option "accept-new" | Automatic — entrypoint detects OpenSSH version |
accept-new compatibility by OS:
| OpenSSH | Base OS | Affected PHP |
|---|---|---|
7.4 — no only | Debian 9 Stretch | PHP 5.6, 7.0 |
7.9+ — accept-new ✅ | Debian 10–11 | PHP 7.1–7.4 |
9.6+ — accept-new ✅ | Ubuntu 24.04 | PHP 8.0–8.4 |
Content type
Image
Digest
sha256:084f8a6d7…
Size
380.6 MB
Last updated
about 1 month ago
docker pull alvar0rm/laravel