Environment Variables

December 14, 2025 ยท View on GitHub

Madock supports several environment variables that allow you to customize command behavior without modifying configuration files.

Available Variables

VariableDescriptionDefaultExample
MADOCK_SERVICE_NAMEOverride the target container for command executionphpdb, nginx, node
MADOCK_USEROverride the user inside the containerwww-dataroot
MADOCK_WORKDIROverride the working directory inside the container/var/www/html/var/www/html/app
MADOCK_TTY_ENABLEDEnable/disable TTY mode (useful for CI/CD pipelines)10 or 1

Usage Examples

Disable TTY for CI/CD pipelines

MADOCK_TTY_ENABLED="0" madock cli ls

Run command as root user

MADOCK_USER="root" madock cli whoami

Execute command in a different container

MADOCK_SERVICE_NAME="db" madock bash

Combine multiple variables

MADOCK_USER="root" MADOCK_TTY_ENABLED="0" madock cli "php bin/magento setup:upgrade"

Use Cases

CI/CD Integration

When running Madock commands in non-interactive environments (GitHub Actions, GitLab CI, Jenkins), disable TTY:

MADOCK_TTY_ENABLED="0" madock composer install --no-interaction

Debugging with root access

When you need root privileges to debug permission issues:

MADOCK_USER="root" madock bash