# Custom container images

## Background

Before creating your custom Docker image, ensure that the image you need is not already available on the [Docker Hub](https://hub.docker.com/). Read the [Docker documentation](https://docs.docker.com/get-started/introduction/build-and-push-first-image/) to build your own Docker image.

## Create images

You have two options for host container images:

* Host publicly on Docker Hub&#x20;
* Host privately in a Google Cloud Artifact Registry (see steps below)

### Docker Hub&#x20;

Host publicly on Docker Hub. When using public Docker hub there is not any required integration or security changes required to run containers within your Instruqt sandbox.

1. Within your track sandbox configuration select add host\
   ![](/files/BFRpT7UZ8aPI0PJJg6y7)
2. Provide your hostname and container name. For example public docker hub container "busybox" would just require "busybox" to be put in for the container image name. If you have your own namespace you would prefix the name of your repository with that namespace (ie. namespace/repository)\
   ![](/files/48rhbouGV7ap7HLMkZCD)
3. Click save to add the host to the sandbox

### Google Cloud Artifact Registry

Host privately in a Google Cloud Artifact Registry (see steps below)

{% hint style="warning" %}
Instruqt only supports Linux *x86/amd64* based images. If you are using an Apple Silicon Macbook, use the `--platform=linux/amd64` flag for `docker build command.`
{% endhint %}

If you opt for private images, you need to authorize Instruqt's service accounts access to your repository. You can do so by granting the role `roles/storage.objectViewer` on the backing storage and `roles/artifactregistry.reader` role to the following Instruqt service accounts:

* `serviceAccount:instruqt-participants-nodepool@instruqt-prod.iam.gserviceaccount.com`
* `serviceAccount:instruqt-backend@instruqt-prod.iam.gserviceaccount.com`


---

# 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.instruqt.com/sandboxes/hosts/custom-container-images.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.
