Refactor DTR image management

This commit is contained in:
Joao Fernandes 2017-02-07 12:05:58 -08:00
parent 7e7ff27c7b
commit 636b846f65
12 changed files with 137 additions and 105 deletions

View File

@ -1107,12 +1107,18 @@ toc:
title: Configure your Docker Engine
- path: /datacenter/dtr/2.2/guides/user/access-dtr/use-a-cache/
title: Use a cache
- path: /datacenter/dtr/2.2/guides/user/repos-and-images/
title: Repos and images
- sectiontitle: Manage images
section:
- path: /datacenter/dtr/2.2/guides/user/manage-images/
title: Create a repository
- path: /datacenter/dtr/2.2/guides/user/manage-images/pull-and-push-images/
title: Push and pull images
- path: /datacenter/dtr/2.2/guides/user/manage-images/delete-images/
title: Delete images
- path: /datacenter/dtr/2.2/guides/user/manage-images/scan-images-for-vulnerabilities/
title: Scan images for vulnerabilities
- path: /datacenter/dtr/2.2/guides/user/create-and-manage-webhooks/
title: Create and manage webhooks
- path: /datacenter/dtr/2.2/guides/user/scan-your-images/
title: Scan your images
- path: /datacenter/dtr/2.2/reference/api/
title: API reference
- path: /datacenter/dtr/2.2/guides/support/

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -0,0 +1,15 @@
---
title: Delete images
description: Learn how to delete images from Docker Trusted Registry.
keywords: docker, registry, delete
---
To delete an image, go to the **DTR web UI**, and navigate to the image
**repository** you want to delete. In the **Tags** tab, select all the image
tags you want to delete, and click the **Delete button**.
![](../../images/delete-images-1.png)
You can also delete all image versions, by deleting the repository. For that,
in the image **repository**, navigate to the **Settings** tab, and click the
**Delete** button.

View File

@ -0,0 +1,37 @@
---
title: Create a repository
description: Learn how to create new repositories in Docker Trusted Registry.
keywords: docker, registry, repository
---
Since DTR is secure by default, you need to create the image repository before
being able to push the image to DTR.
In this example, we'll create the 'golang' repository in DTR.
## Create a repository
To create a new repository, navigate to the **DTR web application**, and click
the **New repository** button.
![](../../images/create-repository-1.png)
Add a **name and description** for the repository, and choose whether your
repository is public or private:
* Public repositories are visible to all users, but can only be changed by
users granted with permission to write them.
* Private repositories can only be seen by users that have been granted
permissions to that repository.
![](../../images/create-repository-2.png)
Click **Save** to create the repository.
When creating a repository in DTR, the full name of the repository becomes
`<dtr-domain-name>/<user-or-org>/<repository-name>`. In this example, the full
name of our repository will be `dtr.company.org/dave.lauper/golang`.
## Where to go next
* [Pull and push images](pull-and-push-images.md)

View File

@ -0,0 +1,72 @@
---
title: Pull and push images
description: Learn how to pull and push images to Docker Trusted Registry.
keywords: docker, registry, push, pull
---
You interact with Docker Trusted registry in the same way you interact with
Docker Hub or any other registry:
* `docker login <dtr-url>`: authenticates you on DTR
* `docker pull <image>:<tag>`: pulls an image from DTR
* `docker push <image>:<tag>`: pushes an image to DTR
## Pull an image
Pulling an image from Docker Trusted Registry is the same as pulling an image
from Docker Hub or any other registry. Since DTR is secure by default, you
always need to authenticate before pulling images.
In this example, DTR can be accessed at dtr.company.org, and the user
was granted permissions to access the Java, Python, and Golang repositories.
![](../../images/pull-push-images-1.png)
Click on the repository to see its details.
![](../../images/pull-push-images-2.png)
To pull the 1.7 tag of the dave.lauper/golang image, run:
```bash
$ docker login dtr.company.org
$ docker pull dtr.company.org/dave.lauper/golang:1.7
```
## Push an image
Before you can push an image to DTR you need to [create a repository](index.md)
to store the image. In this example the full name of our repository is
`dtr.company.org/dave.lauper/golang`.
## Tag the image
In this example we'll pull the Golang image from Docker Hub and tag with with
the full DTR and repository name. A tag defines where the image was pulled
from, and where it will be pushed to.
```bash
# Pull from Docker Hub the 1.7 tag of the golang image
$ docker pull golang:1.7
# Tag the golang:1.7 image with the full repository name we've created in DTR
$ docker tag golang:1.7 dtr.company.org/dave.lauper/golang:1.7
```
## Push the image
Now that you have tagged the image, you only need to authenticate and push the
image to DTR.
```bash
$ docker login dtr.company.org
$ docker push dtr.company.org/dave.lauper/golang:1.7
```
Go back to the **DTR web UI** to validate that the tag was successfully pushed.
![](../../images/pull-push-images-3.png)
## Where to go next
* [Delete images](delete-images.md)

View File

@ -1,7 +1,7 @@
---
description: Docker Security Scanning for Docker Trusted Registry.
keywords: docker, registry, scanning, security scan, vulnerability, CVE
title: Docker Security Scanning in DTR
title: Scan images for vulnerabilities
description: Learn how to scan your Docker images for vulnerabilities.
keywords: docker, registry, scan, vulnerability
---
Docker Trusted Registry can scan images in your repositories to verify that they

View File

@ -1,98 +0,0 @@
---
description: Learn how to push an image to Docker Trusted Registry.
keywords: docker, registry, images, pull
title: Work with images in DTR
---
Pushing an image to Docker Trusted Registry is the same as pushing an image
to Docker Hub.
Since DTR is secure by default, you need to create the image repository before
being able to push the image to DTR.
In this example, we'll create the 'golang' repository in DTR, and push the
Golang 1.7 image to it.
## Create a repository
To create a new repository, navigate to the **DTR web application**, and click
the **New repository** button.
![](../images/push-an-image-1.png)
Add a **name and description** for the repository, and choose whether your
repository is public or private:
* Public repositories are visible to all users, but can only be changed by
users granted with permission to write them.
* Private repositories can only be seen by users that have been granted
permissions to that repository.
![](../images/push-an-image-2.png)
Click **Save** to create the repository.
When creating a repository in DTR, the full name of the repository becomes
`<dtr-domain-name>/<user-or-org>/<repository-name>`. In this example, the full
name of our repository will be `dtr.company.org/dave.lauper/golang`.
## Tag the image
Before you can push an image to DTR, you need to tag it with the full
repository name. A tag defines where the image was pulled from, and where
it will be pushed to.
```bash
# Pull from Docker Hub the 1.7 tag of the golang image
$ docker pull golang:1.7
# Tag the golang:1.7 image with the full repository name we've created in DTR
$ docker tag golang:1.7 dtr.company.org/dave.lauper/golang:1.7
```
## Push the image
Now that you have tagged the image, you only need to authenticate and push the
image to DTR.
```bash
$ docker login dtr.company.org
$ docker push dtr.company.org/dave.lauper/golang:1.7
```
Go back to the **DTR web UI** to validate that the tag was successfully pushed.
![](../images/push-an-image-3.png)
## Pull an image from DTR
Pulling an image from Docker Trusted Registry is the same as pulling an image
from Docker Hub. Since DTR is secure by default, you always need to authenticate
before pulling images.
In this example, DTR can be accessed at dtr.company.org, and the user
was granted permissions to access the Java, Python, and Golang repositories.
![](../images/pull-an-image-1.png)
Click on the repository to see its details.
![](../images/pull-an-image-2.png)
To pull the 1.7 tag of the dave.lauper/golang image, run:
```bash
$ docker login dtr.company.org
$ docker pull dtr.company.org/dave.lauper/golang:1.7
```
## Delete an image in DTR
To delete an image, go to the **DTR web UI**, and navigate to the image
**repository** you want to delete. In the **Tags** tab, select all the image
tags you want to delete, and click the **Delete button**.
![](../images/delete-an-image-1.png)
You can also delete all image versions, by deleting the repository. For that,
in the image **repository**, navigate to the **Settings** tab, and click the
**Delete** button.