alvar0rm/laravel

By alvar0rm

Updated about 1 month ago

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

Image
Languages & frameworks
Web servers
0

10K+

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

Las siguientes versiones usan imágenes base EOL. Solo para desarrollo local, nunca exponer a internet.

PHPEOL PHPBase OSEOL OS
5.6Dic 2018Debian 9 StretchJun 2022
7.0Dic 2019Debian 9 StretchJun 2022
7.1Dic 2019Debian 10 BusterJun 2024
7.2Nov 2020Debian 10 BusterJun 2024
7.3Dic 2021Debian 11 BullseyeJun 2026
7.4Nov 2022Debian 11 BullseyeJun 2026
8.0Nov 2023Ubuntu 24.04 LTSAbr 2029
8.1Dic 2024Ubuntu 24.04 LTSAbr 2029
8.2Dic 2025Ubuntu 24.04 LTSAbr 2029

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


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]

LaravelPHPBase OSTags de ejemplo
5.0–5.15.6Debian 95-php5.6, 5.1-php5.6-supervisor
5.2–5.45.6 / 7.0 / 7.1 / 7.2Debian 9–105.2-php7.0, 5.4-php7.2-supervisor
5.57.0 / 7.1 / 7.2 / 7.3 / 7.4Debian 9–115.5-php7.0, 5.5-php7.4-supervisor
5.6–5.87.1 / 7.2 / 7.3 / 7.4Debian 10–115.6-php7.2, 5.8-php7.4-supervisor
6–77.2 / 7.3 / 7.4 / 8.0Debian 10–11 / Ubuntu 24.046-php7.4, 7-php8.0-supervisor
87.3 / 7.4 / 8.0 / 8.1Debian 11 / Ubuntu 24.048-php7.4, 8-php8.1-supervisor
98.0 / 8.1 / 8.2Ubuntu 24.049-php8.0, 9-php8.2-supervisor
108.1 / 8.2 / 8.3Ubuntu 24.0410-php8.1, 10-php8.3-supervisor
118.2 / 8.3 / 8.4Ubuntu 24.0411-php8.2, 11-php8.4-supervisor
128.2 / 8.3 / 8.4Ubuntu 24.0412-php8.3, 12-php8.4-supervisor
138.3 / 8.4Ubuntu 24.0413-php8.3, 13-php8.4-supervisor
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.42.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
Debian 9 Stretch3.3.x
Debian 10 Buster3.3.x
Debian 11 Bullseye4.2.x
Ubuntu 24.04 LTS4.2.x

Extensiones de PHP

ExtensiónPHP 5.6PHP 7.xPHP 8.x
bcmath, gd, intl, opcache, zip
pdo_mysql, pdo_pgsql, pdo_sqlite
mcrypt
pdo_dblib (FreeTDS)
pdo_sqlsrv (SQL Server)
redis
imagick

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 por OS:

OpenSSHOS basePHP afectado
7.4 — no únicamenteDebian 9 StretchPHP 5.6, 7.0
7.9+ — accept-newDebian 10–11PHP 7.1–7.4
9.6+ — accept-newUbuntu 24.04PHP 8.0–8.4


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

The following versions use EOL base images. Local development only — never expose to the internet.

PHPPHP EOLBase OSOS EOL
5.6Dec 2018Debian 9 StretchJun 2022
7.0Dec 2019Debian 9 StretchJun 2022
7.1Dec 2019Debian 10 BusterJun 2024
7.2Nov 2020Debian 10 BusterJun 2024
7.3Dec 2021Debian 11 BullseyeJun 2026
7.4Nov 2022Debian 11 BullseyeJun 2026
8.0Nov 2023Ubuntu 24.04 LTSApr 2029
8.1Dec 2024Ubuntu 24.04 LTSApr 2029
8.2Dec 2025Ubuntu 24.04 LTSApr 2029

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


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]

LaravelPHPBase OSExample Tags
5.0–5.15.6Debian 95-php5.6, 5.1-php5.6-supervisor
5.2–5.45.6 / 7.0 / 7.1 / 7.2Debian 9–105.2-php7.0, 5.4-php7.2-supervisor
5.57.0 / 7.1 / 7.2 / 7.3 / 7.4Debian 9–115.5-php7.0, 5.5-php7.4-supervisor
5.6–5.87.1 / 7.2 / 7.3 / 7.4Debian 10–115.6-php7.2, 5.8-php7.4-supervisor
6–77.2 / 7.3 / 7.4 / 8.0Debian 10–11 / Ubuntu 24.046-php7.4, 7-php8.0-supervisor
87.3 / 7.4 / 8.0 / 8.1Debian 11 / Ubuntu 24.048-php7.4, 8-php8.1-supervisor
98.0 / 8.1 / 8.2Ubuntu 24.049-php8.0, 9-php8.2-supervisor
108.1 / 8.2 / 8.3Ubuntu 24.0410-php8.1, 10-php8.3-supervisor
118.2 / 8.3 / 8.4Ubuntu 24.0411-php8.2, 11-php8.4-supervisor
128.2 / 8.3 / 8.4Ubuntu 24.0412-php8.3, 12-php8.4-supervisor
138.3 / 8.4Ubuntu 24.0413-php8.3, 13-php8.4-supervisor
Composer (by PHP version)
PHPComposer
5.6–8.02.2.27
8.12.3.10
8.22.6.6
8.32.7.9
8.42.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
Debian 9 Stretch3.3.x
Debian 10 Buster3.3.x
Debian 11 Bullseye4.2.x
Ubuntu 24.04 LTS4.2.x

PHP Extensions

ExtensionPHP 5.6PHP 7.xPHP 8.x
bcmath, gd, intl, opcache, zip
pdo_mysql, pdo_pgsql, pdo_sqlite
mcrypt
pdo_dblib (FreeTDS)
pdo_sqlsrv (SQL Server)
redis
imagick

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 by OS:

OpenSSHBase OSAffected PHP
7.4 — no onlyDebian 9 StretchPHP 5.6, 7.0
7.9+ — accept-newDebian 10–11PHP 7.1–7.4
9.6+ — accept-newUbuntu 24.04PHP 8.0–8.4

Tag summary

Content type

Image

Digest

sha256:084f8a6d7

Size

380.6 MB

Last updated

about 1 month ago

docker pull alvar0rm/laravel