From d1d986448cd1da6651bfd018a2e9503ff737f7c1 Mon Sep 17 00:00:00 2001 From: Joxit Date: Wed, 5 Oct 2016 00:31:49 +0200 Subject: [PATCH] [delete image] can activate or not this feature for static image and update README --- README.md | 18 ++++++++++++++++-- bin/entrypoint | 4 ++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e58ce35..1428944 100644 --- a/README.md +++ b/README.md @@ -51,26 +51,40 @@ From sources with this command : ```sh git clone https://github.com/Joxit/docker-registry-ui.git docker build -t joxit/docker-registry-ui docker-registry-ui +docker build -t joxit/docker-registry-ui -f docker-registry-ui/Dockerfile.static docker-registry-ui ``` Or build with the url : ```sh docker build -t joxit/docker-registry-ui github.com/Joxit/docker-registry-ui +docker build -t joxit/docker-registry-ui -f Dockerfile.static github.com/Joxit/docker-registry-ui ``` Or pull the image from [docker hub](https://hub.docker.com/r/joxit/docker-registry-ui/) : ```sh docker pull joxit/docker-registry-ui +docker pull joxit/docker-registry-ui:static ``` #### Run the docker -To run the docker and see the website on your 8080 port, try this : +To run the docker and see the website on your 80 port, try this : ```sh -docker run -d -p 8080:8080 joxit/docker-registry-ui +docker run -d -p 80:80 joxit/docker-registry-ui +``` + +#### Run the static docker + +Some env options are available for use this interface for only one server. + +- `URL`: set the static URL to use. (`Required`) +- `DELETE_IMAGES`: if this variable is empty or `false`, delete feature is desactivated. It is activated otherwise. + +```sh +docker run -d -p 80:80 -e URL=http://127.0.0.1:5000 -e DELETE_IMAGES=true joxit/docker-registry-ui:static ``` ## Using CORS diff --git a/bin/entrypoint b/bin/entrypoint index 17f7fe6..27fc379 100755 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -2,6 +2,10 @@ $@ sed -i "s,\${URL},${URL}," scripts/script.js +if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then + sed -i "s/registryUI.isImageRemoveActivated *= *[^,;]*/registryUI.isImageRemoveActivated=false/" scripts/script.js +fi + if [ -z "$@" ]; then nginx -g "daemon off;" else