Pushing Container Images
In this section you will learn how to make a container image available to GameFabric for subsequent deployment.
Prerequisites
In order to follow this guide, make sure you have the following:
- User credentials to access your GameFabric UI and environment of choice
- API user credentials to push images to the GameFabric Container Registry
- A container image of your game server binary
Log into the GameFabric UI before proceeding.
Create a Branch
If you do not already have a branch in which to push images, you need to create one. In case you haven't already done so, there are two options available to you:
- Add default Branches: This will create two branches, "Production" and "Development", with default Image Retention Policies. Don't worry - you can always change the display names and policies later. See how to edit a branch.
- Create Branch: This will allow you to create a custom branch with a name and an Image Retention Policy of your choice.
Image Retention Policy
The Image Retention Policy defines how long images are stored in the registry and how many tags are retained. The default settings for the Production branch are 30 days and 10 tags. Development and Custom branches have default settings of 14 days and 10 tags. These default settings can be adjusted for any branch.
For example, with Keep Days set to 14 and Keep Count set to 10, images older than 14 days will be deleted, but the process stops if removing an image would leave fewer than 10 images.
Note: Either Keep Days or Keep Count (or both) must be >0. Setting Keep Days or Keep Count to 0 means that specific rule will be ignored.
Add default Branches
INFO
This option is only available if you have not created any branches yet.
Navigate to the Branches section in the GameFabric UI.
Click the Add Default Branches button.
A confirmation pop-up will appear. Click Create to confirm or Cancel to abort.
The default branches are created. You can now see them in the branches overview.
Create custom Branch
You can also create custom branches with a name and an Image Retention Policy of your choice.
- Click the Create Branch button in the branches overview.
- A new window will open, allowing you to create a custom branch.
- Give it a name that makes it easy for other users to identify its purpose, then click the Next button.
- Create the Image Retention Policy. You can define a policy by the Image Retention Policy Name, an Image Regex, a Tag Regex, as well as Keep Count and Keep Days. You can also add multiple policies through the + Add Button, or remove policies through the Remove Button.
- (Optional) If you don't wish to define an Image Retention Policy, you can toggle the switch - but please be aware that this is not recommended.
- Before creating your branch, the UI shows you the URL at which you will be able to push Docker images, to make them a part of this branch. Make note of that URL, as you will need it in the next step.
- Click the Create Branch button to finish the process. The newly created branch will now be visible in the branches overview.
Once the branch is created, you can find that URL again by clicking the View Images button in the row for your branch. This leads you to the branch details page, which displays the relevant URL at the top of the interface, in the blue information box.
Push the game server image
Now, login to the GameFabric Container Registry by running the following command:
$ docker login -u ${USERNAME} -p ${PASSWORD} $URL
INFO
If you encounter issues with your credentials, contact the administrator of your GameFabric installation.
Once you are logged in, tag your image against the registry, and push it. Do not forget to include the branch name after the registry URL.
$ docker tag my-game:v1.2.3 ${URL}/${BRANCH}/my-game:v1.2.3
$ docker push ${URL}/${BRANCH}/my-game:v1.2.3
You should now see the game image listed in the branch detail view.
INFO
We currently can not guarantee that all features work with podman
due to an open bug related to a non standard behaviour. With that being said we support the full feature set of docker CLI and test its functionality with each release.
This means you can now select that image when creating an Armada.