Creating a Custom Docker Image - dteck/Mediawiki-GCP-CR GitHub Wiki
Getting Started
With most of our Google infrastructure set up we need to actually create the custom Docker image we will use to run our wiki. this Github repository holds all of the build files you will need to create the image. I have also hosted a precompiled version of the image on DockerHub which you can find here: dteck04/mediawiki-googlecloud
Installing Docker
The first step to making a custom Docker image will be to install Docker which can be downloaded from their webpage for free. Docker also offers its own walkthrough of the installation process here: https://docs.docker.com/get-docker/
Downloading Build Files
In order to make the custom image you will need three files from this repository.
- The DockerFile - This are the instructions docker uses to assemble the custom image
- The Image-mods-GCP.sh shell script - This contains a series of commands that will install our FUSE mounting system, as well as making some modifications to the Apache server to handle files served from network attached storage, and also set up links between our network storage and the wikis default file locations.
- The fuse_mount.sh shell script - This will be run every time the container starts and it will attach our buckets to the container and then start the webserver to show users the wiki pages.
Building the Customized Image
You want to store all of the files above in one directory together. Then you want to open a command prompt at that location and use docker build command.
docker build -t [Region]-docker.pkg.dev/[Project Name]/[Repository Name]/[Image Name]:[Image Tag] .
You will need to replace the items in brackets with your projects details Example:
- Region = us-central1
- Project Name = wiki
- Repository Name = modified-mediawiki
- Image Name = mediawiki-google
- Image Tag = Ver1
docker build -t us-central1-docker.pkg.dev/wiki/modified-mediawiki/mediawiki-google:Ver1 .
Note: The period after the image tag is important. It tells docker to look in the current directory for the Dockerfile with build instructions. you should now be able to see your newly created image if from your command prompt you use the command
docker images
It should also automatically appear in your list of images in Docker Desktop if you downlaoded and installed that application.
Pulling the Image from DockerHub
If you do not want to build the image yourself you can pull the already created image from DockerHub by using the following command from your command prompt.
docker pull dteck04/mediawiki-googlecloud