$ git clone git@gitlab-clients.sitehost.co.nz:g_1/my-custom-image.git
$ cd ./my-custom-image
Inside our repository you will find all the files and folder structure we need to build a custom image.
$ ls -lah
> drwxrwxr-x 6 user user 4.0K Nov 28 12:04 default-data
> -rw-rw-r-- 1 user user 67 Nov 28 12:04 Dockerfile
> drwxrwxr-x 8 user user 4.0K Nov 28 12:04 .git
> -rw-rw-r-- 1 user user 605 Nov 28 12:04 .gitlab-ci.yml
> -rw-rw-r-- 1 user user 393 Nov 28 12:04 manifest.yml
As you can see our repository contains three files: .gitlab-ci.yml
, manifest.yml
and Dockerfile
These three files are mandatory in every custom image, they define exactly how to build your custom image.
When making a custom image from scratch, you will mainly be changing manifest.yml
and Dockerfile
. You can read more about the manifest.yml file.
The .gitlab-ci.yml
file is used to build your custom image in our CI environment, we do not allow any changes to this file. Any commit that alters this file will be rejected.
You will also notice the default-data directory. This is where you store the files needed for your custom image. For more information please read about the default-data directory.
Images can only be edited locally so you will have to have a copy of the repository on your local machine. After editing a file(s) in the repository you can commit them back to SiteHost for us to build the image by doing the following:
git add ./Dockerfile
git commit -m "Update Dockerfile"
git push
While the image is building you can view the build status and build log from within the Control Panel.
To help you gain a better understanding of how our Custom Images work, we have created a collection of example repositories that showcase various types of images that you can create. They are available from our public GitHub repository:
In this example we are building a Varnish Cache 6.4.0 from scratch that is not forked from one of our existing images.
Custom Image Example - Varnish Cache 6.4.0
In this example we are building an Apache + PHP + ImageMagick forked from one of our existing Apache + PHP images.
Custom Image Example - Apache PHP + ImageMagick
In this example we are building an Apache + PHP + wkhtmltopdf forked from one of our existing Apache + PHP images.
Custom Image Example - Apache PHP + wkhtmltopdf