Skip to content

glpi-project/docker-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

260 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GLPI Docker Images

Release Build

GLPI on docker illustration

GLPI is a free and open source Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.

A few links:

This repository contains build files for docker images available in Github Container Registry and Docker hub.

Summary

How to use this image

docker-compose.yml

name: glpi

services:
  glpi:
    image: "glpi/glpi:latest"
    restart: "unless-stopped"
    volumes:
       # Using a named volume avoids permission issues on host (automatically managed by Docker)
       - glpi_data:/var/glpi
      # For GLPI 10.x, uncomment the following line to create a volume for plugins fetched from the marketplace.
      # - "./storage/glpi_marketplace:/var/www/glpi/marketplace/:rw"
    env_file: .env # Pass environment variables from .env file to the container
    depends_on:
      - db
    ports:
      - "80:80"

  db:
    image: "mysql"
    restart: "unless-stopped"
    volumes:
       - db_data:/var/lib/mysql
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      MYSQL_DATABASE: ${GLPI_DB_NAME}
      MYSQL_USER: ${GLPI_DB_USER}
      MYSQL_PASSWORD: ${GLPI_DB_PASSWORD}

volumes:
   glpi_data:
   db_data:

And an .env file:

.env

GLPI_DB_HOST=db
GLPI_DB_PORT=3306
GLPI_DB_NAME=glpi
GLPI_DB_USER=glpi
GLPI_DB_PASSWORD=glpi

Then launch it with:

docker compose up -d

Please note that we setup a random root password for the MySQL database, so you will need to check the logs of the db container to find it:

docker logs <db_container_id>

Once the containers are running, you can access GLPI at http://localhost GLPI will automatically install or update itself if needed.

You can disable this behavior by setting the environment variable GLPI_SKIP_AUTOINSTALL to true in the .env file. Same with GLPI_SKIP_AUTOUPDATE to disable automatic updates.

If so, when accessing the web interface, installation wizard will ask you to provide the database connection details. You can use the following credentials:

  • Hostname: db
  • Database: glpi
  • User: glpi
  • Password: glpi

Timezones support

If you want to initialize the timezones support for GLPI, we need to first GRANT the glpi user to access the mysql.time_zone table. So with the docker container running, you can run the following command:

docker exec -it <db_container_id> mysql -u root -p -e "GRANT SELECT ON mysql.time_zone_name TO 'glpi'@'%';FLUSH PRIVILEGES;"

The root password will be the one you found in the logs of the db container previously.

Then you can run the following command to initialize the timezones on the GLPI container:

docker exec -it <glpi_container_id> /var/www/glpi/bin/console database:enable_timezones

Volumes

By default, the glpi/glpi image provides a volume containing its config, marketplace and files directories.

For GLPI 10.0.x version the marketplace directory is not declared in the volume as the path differs. You may want to create a manual volume for the path /var/www/glpi/marketplace if you plan to use it.
If you are building your own GLPI 10.0.x image using the glpi/Dockerfile file, you have to specify the marketplace path using the --build-arg GLPI_MARKETPLACE_DIR=/var/www/glpi/marketplace option.

You can also mount a volume containing your own custom plugins in /var/www/glpi/plugins.

Custom PHP configuration

The following example sets the memory limit to 256M

  1. Create an ini file
    custom-config.ini

    memory_limit = 256M
  2. Update the volumes configuration

    volumes:
      - "./custom-config.ini:/usr/local/etc/php/conf.d/custom-config.ini:ro"
  3. Apply the changes

    docker compose up -d
  4. Check the configuration by running on the GLPI container:

    docker compose exec glpi sh -c 'php -r "phpinfo();" | grep memory_limit'

    Or by browsing the GLPI website under Setup > General > System > Server.

Managing Cron tasks

By default, the image includes a background worker that executes GLPI cron tasks every minute. This behavior is controlled by the GLPI_CRONTAB_ENABLED environment variable.

This is especially useful for horizontal scaling or Kubernetes deployments, where you might want a dedicated container for cron tasks while disabling it on Web or API nodes to avoid automatic tasks duplication.

See environment variables section for more details.

Adding custom Cron tasks

Since the container runs as the non-root www-data user, traditional cron is not available. Instead, this image provides a built-in scheduler script that supports interval-based and daily scheduled tasks through supervisord.

See the custom scheduled jobs documentation for usage examples.

Environment variables

Database

All five variables below are required for auto-install and auto-update to work. If any is missing, both features are disabled and GLPI will present the web-based installation wizard instead.

Variable Example Description
GLPI_DB_HOST db Database hostname or IP address
GLPI_DB_PORT 3306 Database TCP port
GLPI_DB_NAME glpi Database name
GLPI_DB_USER glpi Database username
GLPI_DB_PASSWORD secret Database password

Database SSL/TLS configuration:

Only available for GLPI 11.0.7 and above.

Variable Default Description
GLPI_DB_SSL false Set to true to enable SSL/TLS for the database connection
GLPI_DB_SSL_CA (empty) Path to the Certificate Authority (CA) certificate file
GLPI_DB_SSL_CERT (empty) Path to the client certificate file
GLPI_DB_SSL_KEY (empty) Path to the client private key file
GLPI_DB_SSL_CAPATH (empty) Path to a directory containing trusted CA certificates
GLPI_DB_SSL_CIPHER (empty) Allowed cipher(s) for the SSL connection

Installation/Update

Variable Default Description
GLPI_SKIP_AUTOINSTALL false Set to true to skip automatic database installation on first run
GLPI_SKIP_AUTOUPDATE false Set to true to skip automatic database schema updates on restart

Cron

Variable Default Description
GLPI_CRONTAB_ENABLED 1 Set to 0 to disable the background cron worker

Path configuration

These are preconfigured and generally do not need to be changed.

Variable Default Description
GLPI_CONFIG_DIR /var/glpi/config Configuration directory
GLPI_VAR_DIR /var/glpi/files Application data directory
GLPI_LOG_DIR /var/glpi/logs Log files directory
GLPI_MARKETPLACE_DIR /var/glpi/marketplace Plugin marketplace directory

Image Maintenance Policy

Image maintenance is run and hosted on the GLPI project under a scheduled GitHub workflow.

Weekly Security Rebuilds

GLPI nightly and security rebuild

The images corresponding to the latest release from each supported version of GLPI are automatically rebuilt periodically to incorporate the latest security patches from the underlying Debian and PHP base images.

The GLPI application code is never changed during these rebuilds, only the OS, the PHP runtime, and the system libraries are updated.

Pinning to a Specific Image Digest

Every Docker image has a unique SHA256 digest (e.g., sha256:abc123...). Unlike tags, digests are immutable — they always point to the exact same image, even when a tag is updated.

This is useful if you need to rollback to a known-good image after a new release introduces issues, or to pin a production deployment to an exact build.

Finding the digest:

  • In the GitHub Actions workflow summary for the build — each run displays the digests and tags
  • Or using docker inspect: docker inspect --format='{{index .RepoDigests 0}}' glpi/glpi:latest

Using a digest in docker compose:

services:
  glpi:
    image: "glpi/glpi@sha256:abc123def456..."

Pulling by digest:

docker pull glpi/glpi@sha256:abc123def456...

About

Official repository of GLPI Docker images

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors