Launching a container image from a private repository

Launch container images from private repositories #

To deploy applications using private container images on levv cloud, you need to authenticate your private repository credentials and upload them to levv. Below is a step-by-step guide on how to achieve this.

1. Obtain your credentials in JSON format #

Ensure your repository credentials are stored in a JSON file. Most container registries, such as Docker Hub, GitHub, and GitLab, allow you to download or generate these credentials.

2. Upload credentials to levv cloud #

Once you have your credentials, use the following command to upload the .json file to levv cloud:

$ levv auth cir -f ~/.docker/config.json

This example uploads your Docker Hub credentials stored in your home folder. Replace the path with the location of your credentials file for other registries.

3. Modify Your Compose File #

Update your compose file to specify the private image. Here’s an example:

services:
    writer:
        image: your-privaterepo/yourapp:tag
        deploy:
            replicas: 1

Make sure to replace your-privaterepo/yourapp:tag with your actual private image repository and tag.

4. Deploy Your Application #

After updating your compose file, deploy your application with:

$ levv apply -f myapp.yaml

This command will pull the private image using the credentials you provided and launch your application on levv cloud.

For more information, refer to your specific container registry’s documentation on managing and downloading credentials.

Credentials scope #

The credentials that you store on levv cloud are project scoped. When you launch applications that use container images from private repositories, make sure that the credentials are also available within that project.

Check our documentation on projects to learn more about it.

Check the full reference on levv auth cir command.