Jump to content

User:Novem Linguae/Essays/Docker tutorial for Windows (no WSL)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Novem Linguae (talk | contribs) at 12:31, 7 July 2023 (create). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Written from a Windows 10 and PHP perspective.

What is Docker?

Docker is a fancy XAMPP. It lets whatever codebase you're working on pick what OS, what version of PHP, what database, etc. to use instead of depending on whatever version of XAMPP you happened to install.

Why use Docker?

Looking at Reddit threads, here are some of the benefits:

  • Solves "I dunno what your problem is, it works on my machine" issues
  • Quickly spin up unfamiliar infrastructure. For example, if you're not familiar with python, you can run the Docker for a python repo and it'll install the correct version of python and pip (package manager) for you.

How to set up Mediawiki Docker for Windows

  • install Docker Desktop for Windows
  • configure it to use WSL2 (Windows Subsystem for Linux)
  • git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki
  • follow the official instructions at https://github.com/wikimedia/mediawiki/blob/master/DEVELOPERS.md
    • create .env file with default settings
    • docker compose up -d
    • docker compose exec mediawiki composer update
    • docker compose exec mediawiki /bin/bash /docker/install.sh
  • VERY IMPORTANT FOR WINDOWS USERS: docker compose exec mediawiki chmod -R o+rwx cache/sqlite
  • npm ci
  • foreach (skin/extension):
    • git clone
    • composer update
    • npm ci
    • add wfLoadSkin( 'Vector' ); / or similar to LocalSettings.php
  • docker compose exec mediawiki php maintenance/run.php update.php
  • install phpmyadmin (database viewer and editor)