This is a guide to using Container Registries (formerly private registries) in Cortex Fabric.
Cortex users are required to use to a Docker registry to push and pull images for daemons and (job) tasks, and so other account users can deploy images from that registry. Docker registries may require authentication.
For configuration options for Docker registries go here.
- You must be authenticated to Cortex CLI.
- Docker must be installed and running.
The container registry uses the following naming convention:
Login to your private Docker registry
Use the Fabric CLI command to authenticate to Docker.
This is equivalent to running
docker login private-registry.<base-domain> --user "CLI" --password "$(cortex configure token)".
Build an image
Cortex daemons and jobs are executed inside of Docker images. When you deploy these actions, you need to make a Docker image available to Cortex by pushing it to a Docker Registry.
Make sure that you have Docker running on your machine.
All Docker images are created by following instructions indicated in a
Dockerfile, which is usually found in the base directory of your application or repository. Dockerfiles contain two elements: a base image from which the Docker image is based, and commands that provide instructions on what to run inside the image or other parameters for that image.
For best practices on how to write a Dockerfile, see Dockerfile best practices.
Docker deploy steps
These steps are provided in case you need to know the full steps for a CI/CD pipeline.
In a command line application, navigate to the directory containing your Dockerfile.
Log in into your Docker registry.cortex docker login
Build a new local docker image.docker build -t <image-name>:<version> .
This creates a new Docker image tagged with the
<image-name>:<version>that you specify.
Tag your docker image to the Fabric registry.docker tag <image-name>:<version> private-registry.<base-domain>/<image-name>:<version>
Push the image to Cortex's container (private) registry.docker push private-registry.<base-domain>/<image-name>:<version>
The image is now available to deploy.