how to actually install mediawiki and run with docker?

I tried

mediawiki docker

it says:

When first run, the container will not contain a LocalSettings.php

But i don't understand how to get this contained LocalSettings.php what do I type to get this file? and how to I replace it?


The docker images from mediawiki docker uses Volumes which is clearly given in the description on the page. In case of Docker images with volumes when you download the image you need to create a similar volume on your host too, because downloading a docker image doesn t download the docker volume.

As it is stated on that page, you need to create a volume in the host and put that LocalSettings.php file and then create a container as:

docker stop $CONFIG_CONTAINER
docker run -v /data/wiki:/data -d nickstenning/mediawiki

1.- We need to obtain the name of the docker

docker ps

2.- Obtain a shell inside the docker container

docker exec -it <dockername> /bin/bash

/var/www/html# ls -l
total 1576
-rw-rw-r--  1     1000     1000     168 Sep 24 22:22 CODE_OF_CONDUCT.md
-rw-rw-r--  1     1000     1000   19421 Nov  4  2019 COPYING
-rw-rw-r--  1     1000     1000   13101 Sep 24 22:22 CREDITS
-rw-rw-r--  1     1000     1000      95 Nov  4  2019 FAQ
-rw-rw-r--  1     1000     1000 1151718 Sep 24 22:22 HISTORY
-rw-rw-r--  1     1000     1000    3581 Sep 24 22:22 INSTALL
-rw-rw-r--  1     1000     1000    1525 Sep 24 22:22 README.md
-rw-rw-r--  1     1000     1000   84664 Sep 25 14:36 RELEASE-NOTES-1.35
-rw-rw-r--  1     1000     1000     199 Nov  4  2019 SECURITY
-rw-rw-r--  1     1000     1000   12142 Sep 24 22:22 UPGRADE
-rw-rw-r--  1     1000     1000    4490 Sep 24 22:22 api.php
-rw-rw-r--  1     1000     1000  156532 Sep 24 22:22 autoload.php
drwxr-xr-x  2 www-data www-data    4096 Sep 30 01:19 cache
-rw-rw-r--  1     1000     1000    4719 Sep 24 22:22 composer.json
-rw-rw-r--  1     1000     1000     102 Nov  4  2019 composer.local.json-sample
drwxr-xr-x  5 root     root        4096 Sep 30 01:19 docs
drwxr-xr-x 30 www-data www-data    4096 Sep 30 01:19 extensions
drwxr-xr-x  1 www-data www-data    4096 Oct  1 10:47 images
-rw-rw-r--  1     1000     1000    8245 Sep 24 22:22 img_auth.php
drwxr-xr-x 83 root     root        4096 Sep 30 01:19 includes
-rw-rw-r--  1     1000     1000    1977 Sep 24 22:22 index.php
-rw-rw-r--  1     1000     1000    1428 Sep 24 22:22 jsduck.json
drwxr-xr-x  6 root     root        4096 Sep 30 01:19 languages
-rw-rw-r--  1     1000     1000    1951 Sep 24 22:22 load.php
drwxr-xr-x 14 root     root       12288 Sep 30 01:19 maintenance
drwxr-xr-x  4 root     root        4096 Sep 30 01:19 mw-config
-rw-rw-r--  1     1000     1000    4610 Sep 24 22:22 opensearch_desc.php
drwxr-xr-x  5 root     root        4096 Sep 30 01:19 resources
-rw-rw-r--  1     1000     1000     998 Sep 24 22:22 rest.php
drwxr-xr-x  5 www-data www-data    4096 Sep 30 01:19 skins
drwxr-xr-x 10 root     root        4096 Sep 30 01:19 tests
-rw-rw-r--  1     1000     1000   23408 Sep 24 22:22 thumb.php
-rw-rw-r--  1     1000     1000    1439 Sep 24 22:22 thumb_handler.php
drwxr-xr-x 16 root     root        4096 Sep 30 01:19 vendor
root@e532ae3bb563:/var/www/html# cat > LocalSettings.php

3.- Create a file and copy the contents of LocalSettings.php inside the directory

cat > LocalSettings.php

(and paste with the terminal the contents of the downloaded LocalSettings, you can use some editor but using this command pasting the content and the ctrl+c should work).