Cli/guide/Docker-Development-Environment/Service Interaction

All services that make up the development environment take a common form.

Commands edit

For example, the memcached service has the following commands:

Available Commands:
  create        Create the memcached containers
  destroy       Destroy the memcached containers
  exec          Execute a command in the main memcached container
  resume        Resume the memcached containers
  suspend       Suspend the memcached containers

Some services may have extra convenience commands, for example:

  • mediawiki
    • composer
    • fresh
    • quibble
  • redis
    • redis-cli

Environment Variables edit

Many services have environment variables that can be set to modify behaviour, or even change the image being used.

You can always take a look at the docker-compose files used, and thus environment variables that can be set.

cat $(mw dev where)/memcached.yml

Altering a variable edit

If you want to alter an environment variable on a container, you'll need to re create the container after the change.

For example:

mw docker env set MEDIAWIKI_XDEBUG_CONFIG "client_host=172.21.112.105"
mw docker mediawiki create

You should see that the container recreates:

Recreating mwcli-mwdd-default_mediawiki_1 ... done

Using a different docker image edit

You may want to use a different base image for your MediaWiki container. For example, you might want to use a different PHP version than the default. You can do so by setting the MEDIAWIKI_IMAGE environment variable:

mw docker env set MEDIAWIKI_IMAGE docker-registry.wikimedia.org/dev/buster-php74-fpm:1.0.0
mw docker mediawiki create