Skip to content

Commit 19fad1e

Browse files
joaofnfernandesJim Galasyn
authored and
Jim Galasyn
committed
[WIP] Introduce repo creation on push (#273)
Introduce repo creation on push
1 parent a7bb1ea commit 19fad1e

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ dtr_versions:
5656
tablabels:
5757
ucp-3.0: Universal Control Plane 3.0
5858
ucp-2.2: Universal Control Plane 2.2
59+
dtr-2.5: Docker Trusted Registry 2.5
5960
docker-cli-linux: Docker CLI on Mac/Linux
6061
docker-cli-win: Docker CLI on Windows
6162
kubectl: Kubernetes CLI
63+
cli: CLI
6264

6365
collections:
6466
samples:

deploy/allow-creation-on-push.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Allow users to create repositories when pushing
3+
description: By default Docker Trusted Registry only allows pushing images to
4+
existing repositories. Learn how to change that.
5+
keywords: dtr, repository
6+
ui_tabs:
7+
- version: dtr-2.5
8+
orhigher: true
9+
cli_tabs:
10+
- version: cli
11+
---
12+
13+
{% if include.ui %}
14+
{% if include.version=="dtr-2.5" %}
15+
By default DTR only allows pushing images if the repository exists, and you
16+
have write access to the repository.
17+
18+
As an example, if you try to push to `dtr.example.org/library/java:9`, and the
19+
`library/java` repository doesn't exist yet, your push fails.
20+
21+
You can configure DTR to allow pushing to repositories that don't exist yet.
22+
As an administrator, log into the **DTR web UI**, navigate to the **Settings**
23+
page, and enable **Create repository on push**.
24+
25+
![DTR settings page](images/create-on-push-1.png){: .with-border}
26+
27+
From now on, when a user pushes to their personal sandbox
28+
(`<user-name>/<repository>`), or if the user is an administrator for the
29+
organization (`<org>/<repository>`), DTR will create a repository if it doesn't
30+
exist yet. In that case, the repository is created as private.
31+
{% endif %}
32+
{% endif %}
33+
34+
35+
{% if include.cli %}
36+
```bash
37+
curl --user <admin-user>:<password> \
38+
--request POST "<dtr-url>/api/v0/meta/settings" \
39+
--header "accept: application/json" \
40+
--header "content-type: application/json" \
41+
--data "{ \"createRepositoryOnPush\": true}"
42+
```
43+
{% endif %}

deploy/images/create-on-push-1.png

259 KB
Loading

0 commit comments

Comments
 (0)