Skip to content

Commit 29c17b1

Browse files
committed
docs: add documentation + example for DEFAULT_REGISTRIES and READ_ONLY_REGISTRIES
1 parent b323dc6 commit 29c17b1

File tree

5 files changed

+69
-10
lines changed

5 files changed

+69
-10
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ This web user interface uses [Riot](https://github.com/Riot/riot) the react-like
4444
- Show/Hide content digest in taglist via `SHOW_CONTENT_DIGEST` (values are: [`true`, `false`], default: `false`) (see [#126](https://github.com/Joxit/docker-registry-ui/issues/126)).
4545
- Limit the number of elements in the image list via `CATALOG_ELEMENTS_LIMIT` (see [#127](https://github.com/Joxit/docker-registry-ui/pull/127)).
4646
- Multi arch support in history page (see [#130](https://github.com/Joxit/docker-registry-ui/issues/130) and [#134](https://github.com/Joxit/docker-registry-ui/pull/134))
47+
- Set a list of default registries with `DEFAULT_REGISTRIES` (see [#219](https://github.com/Joxit/docker-registry-ui/pull/219)).
48+
- Desactivate add and remove regisitries with `READ_ONLY_REGISTRIES` (see [#219](https://github.com/Joxit/docker-registry-ui/pull/219)).
4749

4850
## FAQ
4951

@@ -85,9 +87,11 @@ Some env options are available for use this interface for **only one server**.
8587
- `DELETE_IMAGES`: Set if we can delete images from the UI. (default: `false`)
8688
- `SHOW_CONTENT_DIGEST`: Show content digest in docker tag list. (default: `false`)
8789
- `CATALOG_ELEMENTS_LIMIT`: Limit the number of elements in the catalog page. (default: `100000`).
88-
- `SINGLE_REGISTRY`: Remove the menu that show the dialogs to add, remove and change the endpoint of your docker registry. (default `false`)
90+
- `SINGLE_REGISTRY`: Remove the menu that show the dialogs to add, remove and change the endpoint of your docker registry. (default: `false`).
8991
- `NGINX_PROXY_PASS_URL`: Update the default Nginx configuration and set the **proxy_pass** to your backend docker registry (this avoid CORS configuration). This is usually the name of your registry container in the form `http://registry:5000`.
9092
- `NGINX_PROXY_HEADER_*`: Update the default Nginx configuration and set **custom headers** for your backend docker registry. Only when `NGINX_PROXY_PASS_URL` is used.
93+
- `DEFAULT_REGISTRIES`: List of comma separated registry URLs (e.g `http://registry.example.com,http://registry:5000`), available only when `SINGLE_REGISTRY=false`. (default: ` `).
94+
- `READ_ONLY_REGISTRIES`: Desactivate dialog for remove and add new registries, available only when `SINGLE_REGISTRY=false`. (default: `false`).
9195

9296
There are some examples with [docker-compose](https://docs.docker.com/compose/) and docker-registry-ui as proxy [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-proxy/) or docker-registry-ui as standalone [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-standalone/).
9397

@@ -182,3 +186,4 @@ check out the [Electron](examples/electron/README.md) standalone application.
182186
- [UI showing same sha256 content digest for all tags + Delete is not working](https://github.com/Joxit/docker-registry-ui/tree/main/examples/issue-116) ([#116](https://github.com/Joxit/docker-registry-ui/issues/116))
183187
- [Electron-based Standalone Application](https://github.com/Joxit/docker-registry-ui/tree/main/examples/electron) ([#129](https://github.com/Joxit/docker-registry-ui/pull/129))
184188
- [Use docker-registry-ui as proxy with read-only right](https://github.com/Joxit/docker-registry-ui/tree/main/examples/read-only-auth) ([#47](https://github.com/Joxit/docker-registry-ui/issues/47))
189+
- [Use DEFAULT_REGISTRIES and READ_ONLY_REGISTRIES](https://github.com/Joxit/docker-registry-ui/tree/main/examples/pr-219) ([#219](https://github.com/Joxit/docker-registry-ui/issues/219))

bin/entrypoint

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/sh
22

3-
sed -i "s,\${REGISTRY_URL},${REGISTRY_URL}," index.html
4-
sed -i "s,\${REGISTRY_TITLE},${REGISTRY_TITLE}," index.html
5-
sed -i "s,\${PULL_URL},${PULL_URL}," index.html
6-
sed -i "s,\${SINGLE_REGISTRY},${SINGLE_REGISTRY}," index.html
7-
sed -i "s/\${CATALOG_ELEMENTS_LIMIT}/${CATALOG_ELEMENTS_LIMIT}/" index.html
8-
sed -i "s/\${SHOW_CONTENT_DIGEST}/${SHOW_CONTENT_DIGEST}/" index.html
9-
sed -i "s/\${DEFAULT_REGISTRIES}/${DEFAULT_REGISTRIES}/" index.html
10-
sed -i "s/\${READ_ONLY_REGISTRIES}/${READ_ONLY_REGISTRIES}/" index.html
3+
sed -i "s~\${REGISTRY_URL}~${REGISTRY_URL}~" index.html
4+
sed -i "s~\${REGISTRY_TITLE}~${REGISTRY_TITLE}~" index.html
5+
sed -i "s~\${PULL_URL}~${PULL_URL}~" index.html
6+
sed -i "s~\${SINGLE_REGISTRY}~${SINGLE_REGISTRY}~" index.html
7+
sed -i "s~\${CATALOG_ELEMENTS_LIMIT}~${CATALOG_ELEMENTS_LIMIT}~" index.html
8+
sed -i "s~\${SHOW_CONTENT_DIGEST}~${SHOW_CONTENT_DIGEST}~" index.html
9+
sed -i "s~\${DEFAULT_REGISTRIES}~${DEFAULT_REGISTRIES}~" index.html
10+
sed -i "s~\${READ_ONLY_REGISTRIES}~${READ_ONLY_REGISTRIES}~" index.html
1111

1212
if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
1313
sed -i "s/\${DELETE_IMAGES}/false/" index.html

examples/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
- [Add custom headers bases on environment variable and/or file when the ui is used as proxy](https://github.com/Joxit/docker-registry-ui/tree/main/examples/proxy-headers) ([#89](https://github.com/Joxit/docker-registry-ui/pull/89))
1111
- [UI showing same sha256 content digest for all tags + Delete is not working](https://github.com/Joxit/docker-registry-ui/tree/main/examples/issue-116) ([#116](https://github.com/Joxit/docker-registry-ui/issues/116))
1212
- [Electron-based Standalone Application](https://github.com/Joxit/docker-registry-ui/tree/main/examples/electron) ([#129](https://github.com/Joxit/docker-registry-ui/pull/129))
13-
- [Use docker-registry-ui as proxy with read-only right](https://github.com/Joxit/docker-registry-ui/tree/main/examples/read-only-auth) ([#47](https://github.com/Joxit/docker-registry-ui/issues/47))
13+
- [Use docker-registry-ui as proxy with read-only right](https://github.com/Joxit/docker-registry-ui/tree/main/examples/read-only-auth) ([#47](https://github.com/Joxit/docker-registry-ui/issues/47))
14+
- [Use DEFAULT_REGISTRIES and READ_ONLY_REGISTRIES](https://github.com/Joxit/docker-registry-ui/tree/main/examples/pr-219) ([#219](https://github.com/Joxit/docker-registry-ui/issues/219))

examples/pr-219/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Example for pull request #219
2+
3+
Basic usage for `DEFAULT_REGISTRIES` and `READ_ONLY_REGISTRIES`.
4+
5+
Behaviors:
6+
- `DEFAULT_REGISTRIES`:
7+
- will set the list of registries in the localstorage when the localstorage is empty.
8+
- will overwrite the list of registries every time when `READ_ONLY_REGISTRIES=true`
9+
- `READ_ONLY_REGISTRIES`:
10+
- will remove dialog for Add and Remove registries
11+
12+
These options works only when `SINGLE_REGISTRY=false`
13+
14+
See [#219](https://github.com/Joxit/docker-registry-ui/pull/219)

examples/pr-219/docker-compose.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '2'
2+
3+
services:
4+
registry_1:
5+
image: registry:latest
6+
restart: always
7+
ports:
8+
- 5000:5000
9+
container_name: registry_1
10+
environment:
11+
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin: "['*']"
12+
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
13+
volumes:
14+
- ./data:/var/lib/registry
15+
16+
registry_2:
17+
image: registry:latest
18+
restart: always
19+
ports:
20+
- 5001:5000
21+
container_name: registry_2
22+
environment:
23+
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin: "['*']"
24+
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
25+
volumes:
26+
- ./data:/var/lib/registry
27+
28+
ui:
29+
image: joxit/docker-registry-ui:latest
30+
restart: always
31+
container_name: registry-ui
32+
environment:
33+
- REGISTRY_TITLE=Private Docker Registry
34+
- DEFAULT_REGISTRIES=http://localhost:5000,http://localhost:5001
35+
- DELETE_IMAGES=true
36+
- READ_ONLY_REGISTRIES=true
37+
- SINGLE_REGISTRY=false
38+
ports:
39+
- 80:80

0 commit comments

Comments
 (0)