Skip to main content
Version: okteto.com (0.14)

Okteto Registry

The Okteto Registry allows every Okteto namespace to have its own space to store its container images.

Authentication

You can use Okteto CLI to build and push images to the Okteto Registry.

Run okteto context to configure Okteto CLI to be able to push images. This command will download the required tokens and certificates required to push and pull images to the Okteto Registry.

Push images into the Okteto Registry

The Okteto CLI is automatically configured to interact with the Okteto Registry. Just make sure that you're using the registry URL with your Okteto namespace.

okteto build -t okteto.dev/hello-world:golang .

When using the Okteto CLI, you can use the notation okteto.dev to refer to images in your Namespace. okteto.dev gets expanded to registry.cloud.okteto.net/<okteto-namespace>. For example, okteto.dev/hello-world:golang expands to registry.cloud.okteto.net/cindy/hello-world:golang for the namespace cindy and expands to registry.cloud.okteto.net/tom/hello-world:golang for the namespace tom. You can configure your current namespace using Okteto CLI's okteto namespace command.

You can also use okteto.dev in your Dockerfiles when building using the Okteto CLI.

# Dockerfile 
FROM okteto.dev/hello-world:golang
WORKDIR /app
COPY main.go ./
RUN go build -o /usr/local/bin/hello-world
EXPOSE 8080
CMD ["/usr/local/bin/hello-world"]

However, please note that this would not work if you try to build using docker build instead. In that case, you'll need to use the full expanded URL for your images.

When using the expanded URL for the Okteto Registry, please make sure that your image names follow the following scheme, where <okteto-namespace> is a valid Okteto Namespace.

registry.cloud.okteto.net/<okteto-namespace>/<image>:<tag>

Use images from the Okteto Registry

Any image pushed into the Okteto Registry is private. You'll need to authenticate with the registry before pulling an image.

Namespaces in Okteto Cloud are automatically allowed to pull images that belong to their namespace automatically. If your application uses images from the Okteto Registry, it'll be able to pull container images without any extra configuration.

To pull an image from a different namespace, you'll need to create and configure the required imagePullSecrets as outlined here.