Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set default value for AWS endpoint.
  • Loading branch information
cdchris12 committed Apr 6, 2020
1 parent 90d97f8 commit 5b43ece
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions services/harborregistry/Dockerfile
Expand Up @@ -3,6 +3,8 @@ FROM goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.10.0
COPY entrypoint.sh /home/harbor/
COPY --chown=harbor:root install_cert.sh /home/harbor/

ENV HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT="https://s3.amazonaws.com"

USER root

RUN chmod -R g+w /etc/pki/tls/certs \
Expand Down
5 changes: 1 addition & 4 deletions services/harborregistry/entrypoint.sh
Expand Up @@ -31,10 +31,7 @@ if [[ -f "/etc/registry/pre_config.yml" ]]; then
fi
fi

if [[ -z ${HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT+x} ]]; then # Using the default s3 endpoint
sed -e "s|\$HARBOR_NGINX_ENDPOINT|$HARBOR_NGINX_ENDPOINT|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT|\"https://s3.amazonaws.com\"|g" /etc/registry/pre_config.yml > /etc/registry/config.yml
else # Setting up a non-default s3 endpoint
sed -e "s|\$HARBOR_NGINX_ENDPOINT|$HARBOR_NGINX_ENDPOINT|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT|$HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT|g" /etc/registry/pre_config.yml > /etc/registry/config.yml
sed -e "s|\$HARBOR_NGINX_ENDPOINT|$HARBOR_NGINX_ENDPOINT|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|$HARBOR_REGISTRY_STORAGE_AMAZON_REGION|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|$HARBOR_REGISTRY_STORAGE_AMAZON_BUCKET|g" -e "s|\$HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT|$HARBOR_REGISTRY_STORAGE_AMAZON_ENDPOINT|g" /etc/registry/pre_config.yml > /etc/registry/config.yml
fi
fi

Expand Down

0 comments on commit 5b43ece

Please sign in to comment.