Docker Model Registry
About 299 wordsAbout 1 min
Login
Use your CNB access token to log in. Refer to Creating an Access Token for obtaining CNB_TOKEN.
docker login -u cnb -p <YOUR_TOKEN> docker-model.cnb.coolNote: The Docker Model registry only accepts Docker Model artifacts. Pushing other artifact types such as container images or Helm Charts to the Docker Model registry address will be rejected. Ensure the push target matches the artifact type (see Artifact Type Admission Restrictions).
Artifact Path Rules
When publishing artifacts to a repository, two naming rules are supported:
- Same-name artifacts: Artifact path matches repository path, e.g.
docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE} - Different-name artifacts: Repository path serves as namespace, artifact path = repository path/artifact name, e.g.
docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE}/<IMAGE_NAME>
Pushing Artifacts
Local CLI
docker model package --gguf model_file_path \
--push docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE}:latest
# non-same-name artifact
docker model package --gguf model_file_path \
--push docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE}/<IMAGE_NAME>:latestCloud Native Build
Example for pushing a same-name artifact:
.cnb.yml
main:
push:
- services:
- docker
stages:
- name: docker model package & push
# model_file_path is the model file path, e.g. ./model.gguf
# <tag> is the artifact version, e.g. latest or a specific version
script: docker model package --gguf model_file_path --push ${CNB_DOCKER_MODEL_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:<tag>For a different-name artifact, append repository path/artifact name to the path:
docker model package --gguf model_file_path --push ${CNB_DOCKER_MODEL_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}/<IMAGE_NAME>:<tag>Workspaces
docker model package --gguf model_file_path \
--push docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE}:latest
# non-same-name artifact
docker model package --gguf model_file_path \
--push docker-model.cnb.cool/${CNB_REPO_SLUG_LOWERCASE}/<IMAGE_NAME>:latestPulling Artifacts
docker model pull docker-model.cnb.cool/<ARTIFACT_PATH>:latest