Docker Artifact Registry
About 274 wordsLess than 1 minute
Login to CNB Docker Artifact Registry
You can use CNB access token as login credentials, login command:
docker login docker.cnb.cool -u cnb -p {token-value}
Docker 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.cnb.cool/{repository-path}
- Different-name artifacts - Repository path serves as namespace for artifacts, artifact path = repository path/artifact name, e.g.:
docker.cnb.cool/{repository-path}/{artifact-name}
Pushing Artifacts
Push from Local Command Line
Same-name artifacts
docker build -t docker.cnb.cool/{repository-path}:latest .
docker push docker.cnb.cool/{repository-path}:latest
Different-name artifacts
docker build -t docker.cnb.cool/{repository-path}/{image-name}:latest .
docker push docker.cnb.cool/{repository-path}/{image-name}:latest
Push in Cloud Native Build
main:
push:
- services:
- docker
stages:
- name: docker build
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest .
- name: docker push
script: docker push ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest
Push in Workspaces
Same-name artifacts
docker build -t docker.cnb.cool/{repository-path}:latest .
docker push docker.cnb.cool/{repository-path}:latest
Different-name artifacts
docker build -t docker.cnb.cool/{repository-path}/{image-name}:latest .
docker push docker.cnb.cool/{repository-path}/{image-name}:latest
Using Artifacts
Use in Command Line
docker pull docker.cnb.cool/{artifact-path}:latest
# ...
Customize Cloud Native Build Environment
main:
push:
- docker:
image: docker.cnb.cool/{artifact-path}:latest
stages:
- name: hello world
script: echo "Hello World"
Customize Workspaces Environment
$:
vscode:
- docker:
image: docker.cnb.cool/{artifact-path}:latest
services:
- vscode
- docker
More Usage
For more Docker usage, please refer to the official documentation