mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-28 21:25:55 +01:00
add warning to registry binary name
Fixes #11606 As we DO NOT want to user to execute GC in the container, rename it and append the warning message. Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
adb305e4e1
commit
ff2a6c7a01
@ -4,12 +4,12 @@ FROM ${harbor_base_namespace}/harbor-registry-base:${harbor_base_image_version}
|
|||||||
|
|
||||||
COPY ./make/photon/common/install_cert.sh /home/harbor
|
COPY ./make/photon/common/install_cert.sh /home/harbor
|
||||||
COPY ./make/photon/registry/entrypoint.sh /home/harbor
|
COPY ./make/photon/registry/entrypoint.sh /home/harbor
|
||||||
COPY ./make/photon/registry/binary/registry /usr/bin
|
COPY ./make/photon/registry/binary/registry /usr/bin/registry_DO_NOT_USE_GC
|
||||||
|
|
||||||
RUN chown -R harbor:harbor /etc/pki/tls/certs \
|
RUN chown -R harbor:harbor /etc/pki/tls/certs \
|
||||||
&& chown harbor:harbor /home/harbor/entrypoint.sh && chmod u+x /home/harbor/entrypoint.sh \
|
&& chown harbor:harbor /home/harbor/entrypoint.sh && chmod u+x /home/harbor/entrypoint.sh \
|
||||||
&& chown harbor:harbor /home/harbor/install_cert.sh && chmod u+x /home/harbor/install_cert.sh \
|
&& chown harbor:harbor /home/harbor/install_cert.sh && chmod u+x /home/harbor/install_cert.sh \
|
||||||
&& chown harbor:harbor /usr/bin/registry && chmod u+x /usr/bin/registry
|
&& chown harbor:harbor /usr/bin/registry_DO_NOT_USE_GC && chmod u+x /usr/bin/registry_DO_NOT_USE_GC
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:5000 || curl -k --fail -s https://127.0.0.1:5443 || exit 1
|
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:5000 || curl -k --fail -s https://127.0.0.1:5443 || exit 1
|
||||||
|
|
||||||
|
@ -10,4 +10,4 @@ set -e
|
|||||||
|
|
||||||
/home/harbor/install_cert.sh
|
/home/harbor/install_cert.sh
|
||||||
|
|
||||||
/usr/bin/registry serve /etc/registry/config.yml
|
/usr/bin/registry_DO_NOT_USE_GC serve /etc/registry/config.yml
|
||||||
|
@ -3,13 +3,13 @@ ARG harbor_base_namespace
|
|||||||
FROM ${harbor_base_namespace}/harbor-registryctl-base:${harbor_base_image_version}
|
FROM ${harbor_base_namespace}/harbor-registryctl-base:${harbor_base_image_version}
|
||||||
|
|
||||||
COPY ./make/photon/common/install_cert.sh /home/harbor
|
COPY ./make/photon/common/install_cert.sh /home/harbor
|
||||||
COPY ./make/photon/registry/binary/registry /usr/bin
|
COPY ./make/photon/registry/binary/registry /usr/bin/registry_DO_NOT_USE_GC
|
||||||
COPY ./make/photon/registryctl/start.sh /home/harbor
|
COPY ./make/photon/registryctl/start.sh /home/harbor
|
||||||
COPY ./make/photon/registryctl/harbor_registryctl /home/harbor
|
COPY ./make/photon/registryctl/harbor_registryctl /home/harbor
|
||||||
|
|
||||||
RUN chown -R harbor:harbor /etc/pki/tls/certs \
|
RUN chown -R harbor:harbor /etc/pki/tls/certs \
|
||||||
&& chown harbor:harbor /home/harbor/harbor_registryctl && chmod u+x /home/harbor/harbor_registryctl \
|
&& chown harbor:harbor /home/harbor/harbor_registryctl && chmod u+x /home/harbor/harbor_registryctl \
|
||||||
&& chown harbor:harbor /usr/bin/registry && chmod u+x /usr/bin/registry \
|
&& chown harbor:harbor /usr/bin/registry_DO_NOT_USE_GC && chmod u+x /usr/bin/registry_DO_NOT_USE_GC \
|
||||||
&& chown harbor:harbor /home/harbor/start.sh && chmod u+x /home/harbor/start.sh \
|
&& chown harbor:harbor /home/harbor/start.sh && chmod u+x /home/harbor/start.sh \
|
||||||
&& chown harbor:harbor /home/harbor/install_cert.sh && chmod u+x /home/harbor/install_cert.sh
|
&& chown harbor:harbor /home/harbor/install_cert.sh && chmod u+x /home/harbor/install_cert.sh
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ type GCResult struct {
|
|||||||
|
|
||||||
// StartGC ...
|
// StartGC ...
|
||||||
func StartGC(w http.ResponseWriter, r *http.Request) {
|
func StartGC(w http.ResponseWriter, r *http.Request) {
|
||||||
cmd := exec.Command("/bin/bash", "-c", "registry garbage-collect --delete-untagged=false "+regConf)
|
cmd := exec.Command("/bin/bash", "-c", "registry_DO_NOT_USE_GC garbage-collect --delete-untagged=false "+regConf)
|
||||||
var outBuf, errBuf bytes.Buffer
|
var outBuf, errBuf bytes.Buffer
|
||||||
cmd.Stdout = &outBuf
|
cmd.Stdout = &outBuf
|
||||||
cmd.Stderr = &errBuf
|
cmd.Stderr = &errBuf
|
||||||
|
Loading…
Reference in New Issue
Block a user