# Container Registry

Now that you know how to use our platform, you need to containerize your game server. You will need a place to store your container images to be accessible when deploying your game servers.

That is why we created the Edgegap Container Registry. It is a privately managed container repository that works much like standard public container registries, but with the added benefit of increased security, vulnerability scans and other goodies! With high availability and dashboard integration, you will spend less time learning new tools, and your servers will always be ready to go.

### Getting your credentials

To push images, you will first need to authenticate to our registry, and for that, you need credentials. Find the `Container Registry` tab in the `Service` section to request your credentials in the sidebar. From there, you can request access to our registry.

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-323308a355e5937e7bcd4dfdbf75cd0d4517ac86%2Frequest-access.png?alt=media" alt=""><figcaption></figcaption></figure>

In the box at the bottom of the screen, you will find everything you need to connect to the registry and push your container images.

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-ed6f68d538b2ea4944d14989c82351b09dc3914c%2Fregistry-project-info.png?alt=media" alt=""><figcaption></figcaption></figure>

| Field    | Description                                                                                    |
| -------- | ---------------------------------------------------------------------------------------------- |
| URL      | The URL of our container registry. You will need to use it when logging in and pushing images. |
| Project  | The name of your assigned project. You must include it in your image repository path.          |
| Username | The username to use when logging in to the registry.                                           |
| Token    | The password to use when logging in to the registry.                                           |

You can now login to the repository using your tool of choice:

#### Linux

```bash
# enter your password when prompted
docker login -u '<REPOSITORY_USERNAME>' registry.edgegap.com
```

#### cmd

```bash
# enter your password when prompted
docker login -u <REPOSITORY_USERNAME> registry.edgegap.com
```

#### Powershell

```bash
# enter your password when prompted
docker login -u '<REPOSITORY_USERNAME>' registry.edgegap.com
```

### Docker login Warning

```
WARNING! Your password will be stored unencrypted in /home/user/.docker/config.json.
```

You can configure the credentials store by following [this setup](https://docs.docker.com/engine/reference/commandline/login/#credentials-store). Remember that this warning is normal behaviour from Docker.

It's **important** that you understand that your robot username, and the token for your private repository are encoded in base64 in your machine at this path `$HOME/.docker/config.json`. Anybody who has access to this file can easily decrypt your robot account token with a base64 decoder. Ensure that the environment `docker login registry.edgegap.com` you use is safe and that the access permissions to this file are restricted.

To remove your credentials from this file, you can easily use `docker logout registry.edgegap.com` each time you push and pull your private images.

### Pushing an image to the registry

If you need help containerizing your project, see [our documentation on this topic](https://docs.edgegap.com/docs/tools-and-integrations/container/docker) to get you started.

First, you need to add a tag to your image corresponding to the registry. Then, since you are logged in to the registry, all you need to do is push your image to the URL and project found on the page:

```bash
docker image tag <IMAGE_NAME>:<TAG> registry.edgegap.com/<PROJECT_NAME>/<IMAGE_NAME>:<TAG>
docker push registry.edgegap.com/<PROJECT_NAME>/<IMAGE_NAME>:<TAG>
```

You may push as many images as your storage permits and separate them in different repositories as you see fit. However, you should read the "App templates" section before pushing too many images!

You will then find your repositories on the same page upon refreshing.

### Tagging the same build artifact multiple times (pushing an image duplicate)

If you happen to push the same build artifact twice, if the tag value is the same no change will be made.

If you happen to push the same build artifact twice, with two different tag values, no additional storage space will be consumed and our registry will simply create the new tag pointing to the same build artifact.

### Managing your images

You may see your repositories by going to the same page after you have pushed at least one image.

By clicking on one of those repositories, you can see the images it contains, grouped by artifact. If you tagged the same image with two different tags and pushed those to the registry, you will see them as the same artifact.

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-0a4a754f4b880aa351d7a77ff94cad5335a59831%2Fartifact-list.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-7afcf8e2f1ef701a0b2dc7aa8d54b56529f7c6eb%2Fartifact-list-2.png?alt=media" alt=""><figcaption></figcaption></figure>

The images tagged `1.0.1` and `1.0.2` in the picture above have the same artifact. The image tagged `1.0.3`, however, has a different artifact.

{% hint style="warning" %}
If you delete an artifact, you will also delete its associated tags. The confirmation dialogue will list all the tags that this action would delete to ensure you do not accidentally delete needed resources.
{% endhint %}

### Delete build artifacts via API

If the dashboard UI is too slow for you, or you need an automated continuous integration pipeline that would delete your outdated build artifacts automatically to keep your registry usage within limits, consider using our Container Registry API. Our [Container Registry API](https://docs.edgegap.com/docs/api) allows listing all tags for a given app (image), as well as deleting individual tags. Since each image artifact (build) may have multiple tags associated at the same time (such as `v1.1.0`, `dev`, `latest`, or more), you will need to delete all tags associated with a specific artifact in order to free up space in your Edgegap Container Registry.

### Requesting more storage

When your request for access to the registry has been approved, you will be given a certain amount of storage space in the registry.

You may request additional space by clicking on the "Request more storage" button next to the space usage indicator.

<figure><img src="https://3027732442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR0dHSFv9ymoC0DO5G8J%2Fuploads%2Fgit-blob-81bdfd593994140a1a5a5f915b5e1242b32ef8fb%2Frequest-more-storage.png?alt=media" alt=""><figcaption></figcaption></figure>

When a staff member has approved your request, you will have more space to push your images.

### Next steps

Learn how to containerize your application with our guide: [Getting started with Docker](https://docs.edgegap.com/docs/tools-and-integrations/container/docker).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgegap.com/learn/advanced-features/edgegap-container-registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
