Add custom dependencies and Dockerfile
To get started building a custom image, create a new directory for your custom agent (e.g./custom_js_packages or /custom_python_packages). In this directory, add your package dependency files and custom Dockerfile, following the instructions below for JavaScript and Python.
JavaScript
Public registry
To add custom JavaScript packages from a public registry, create apackage.json file that includes the packages to install. For example:
Next, create a
Dockerfile with the following contents:
If running the agent on Google Cloud Run, use
us-east1-docker.pkg.dev/superblocks-registry/superblocks/agent for ${SUPERBLOCKS_IMAGE_NAME}. Otherwise, use ghcr.io/superblocksteam/agent.For ${SUPERBLOCKS_IMAGE_TAG} use the desired agent version, or latest (min. supported version is v1.7.3).Private registry
To add JavaScript packages from a private registry, include these packages in yourpackage.json. Also add a .npmrc file with the URL(s) to your private registry and your authentication credentials. For example:
Next, create a
Dockerfile that includes the .npmrc file in the COPY command:
Python
Public registry
To add custom Python packages from a public registry, create arequirements.txt file that includes the packages to install. Next, create a Dockerfile with the following contents:
Private registry
To add Python packages from a private registry, include these packages in yourrequirements.txt file.
In your Dockerfile, also include an extra index URL for your private repository:
Manually install
Python packages with asetup.py script can be installed by creating a wheel, copying it to your Docker image, and installing it using pip.
Update your Dockerfile to include:
Build, publish, and deploy custom image
Once all dependencies are added and theDockerfile is created, build and tag the new image:
After building the image, push the new image tag to your container registry:
With the image available in your container registry, configure your deployment to pull your custom image, and redeploy:
- Terraform
- Kubernetes
- Docker
Update the following value in your agent’s Terraform file

