1.8.1-debian-9-r0 release

This commit is contained in:
Bitnami Bot
2019-07-02 10:41:43 +00:00
parent b8dd8daa6c
commit 726a659209
10 changed files with 294 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
FROM bitnami/minideb-extras-base:stretch-r290
LABEL maintainer "Bitnami <containers@bitnami.com>"
ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
HOME="/" \
OS_ARCH="amd64" \
OS_FLAVOUR="debian-9" \
OS_NAME="linux"
# Install required system packages and dependencies
RUN install_packages ca-certificates curl libc6
RUN . ./libcomponent.sh && component_unpack "harbor-registryctl" "1.8.1-0" --checksum cbb5003fc79f407fc1a04bca404bb81b8fd0dec554317ff3ed3e2449ef6b37f8
RUN . ./libcomponent.sh && component_unpack "harbor-registry" "1.8.1-0" --checksum 3bd6ac2c2d6fcfcfc3f86d52e6562038963afa823127ebd0a76ad712390dbadc
COPY rootfs /
RUN /postunpack.sh
ENV BITNAMI_APP_NAME="harbor-registryctl" \
BITNAMI_IMAGE_VERSION="1.8.1-debian-9-r0" \
NAMI_PREFIX="/.nami" \
PATH="/opt/bitnami/harbor-registryctl/bin:/opt/bitnami/harbor-registry/bin:$PATH"
VOLUME [ "/etc/registry", "/etc/registryctl", "/storage", "/var/lib/registry" ]
EXPOSE 8080 8443
USER 1001
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/run.sh" ]

View File

@@ -0,0 +1,38 @@
version: 0.1
log:
level: info
fields:
service: registry
storage:
cache:
layerinfo: redis
filesystem:
rootdirectory: /storage
maintenance:
uploadpurging:
enabled: false
delete:
enabled: true
redis:
addr: redis:6379
password:
db: 1
http:
addr: :5000
secret: placeholder
debug:
addr: localhost:5001
auth:
token:
issuer: harbor-token-issuer
realm: http://reg.mydomain.com/service/token
rootcertbundle: /etc/registry/root.crt
service: harbor-registry
notifications:
endpoints:
- name: harbor
disabled: false
url: http://core:8080/service/notifications
timeout: 3000ms
threshold: 5
backoff: 1s

View File

@@ -0,0 +1,35 @@
-----BEGIN C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@
---
protocol: "http"
port: 8080
log_level: "INFO"
#https_config:
# cert: "server.crt"
# key: "server.key"

View File

@@ -0,0 +1,18 @@
version: '2'
services:
harbor-registryctl:
image: bitnami/harbor-registryctl:1
ports:
- 80:8080
environment:
- CORE_SECRET=not-a-secure-core-secret
- JOBSERVICE_SECRET=not-a-secure-jobservice-secret
volumes:
- harbor-registry_data:/storage
- ./config/registry/:/etc/registry/:ro
- ./config/registryctl/config.yml:/etc/registryctl/config.yml:ro
volumes:
harbor-registry_data:
driver: local

View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace
# shellcheck disable=SC1091
# Load libraries
. /libbitnami.sh
print_welcome_page
if [[ "$*" = "/run.sh" ]]; then
info "** Starting Harbor Registryctl setup **"
/setup.sh
info "** Harbor Registryctl setup finished! **"
fi
echo ""
exec "$@"

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# shellcheck disable=SC1091
# Load libraries
. /libfs.sh
# Ensure a set of directories exist
for dir in "/var/lib/registry" "/storage" "/etc/registry" "/etc/registryctl"; do
ensure_dir_exists "$dir"
done
# Ensure the non-root user has writing permission at a set of directories
chmod -R g+rwX "/var/lib/registry" "/storage"

View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace
# shellcheck disable=SC1091
# Load libraries
. /liblog.sh
readonly cmd=$(command -v harbor_registryctl)
readonly flags=("-c" "/etc/registryctl/config.yml" "$@")
info "** Starting Harbor Registryctl **"
exec "${cmd}" "${flags[@]}"

View File

@@ -0,0 +1,98 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
# set -o xtrace
# shellcheck disable=SC1091
# Load libraries
. /liblog.sh
. /libos.sh
. /libvalidations.sh
# Auxiliar Functions
########################
# Retrieve a configuration setting value
# Arguments:
# $1 - key
# Returns:
# None
#########################
harbor_registryctl_conf_get() {
local key="${1:?missing key}"
local value
if [[ -f "/etc/registryctl/config.yml" ]]; then
value="$(yq read "/etc/registryctl/config.yml" "$key")"
if [[ "$value" != "null" ]]; then
echo "$value"
fi
fi
}
########################
# Ensures a configuration setting is not empty
# Arguments:
# $1 - config_option
# Returns:
# None
#########################
not_empty_config_option() {
local config_option="${1:?missing config_option}"
if [[ -z "$(harbor_registryctl_conf_get "$config_option")" ]]; then
error "The configuration option \"$config_option\" must be set!"
exit 1
fi
}
########################
# Ensures an environment_variable
# Arguments:
# $1 - env_var
# Returns:
# None
#########################
not_empty_env_var() {
local env_var="${1:?missing env_var}"
if [[ -z "${!env_var:-}" ]]; then
error "The environment variable \"$env_var\" must be set!"
exit 1
fi
}
########################
# Validate Registryctl settings
# Arguments:
# None
# Returns:
# None
#########################
harbor_registryctl_validate() {
info "Validating Harbor Registryctl settings..."
if [[ ! -f "/etc/registryctl/config.yml" ]]; then
error "No configuration file was detected. Please mount your configuration file at \"/etc/registryctl/config.yml\""
exit 1
fi
not_empty_config_option "protocol"
not_empty_config_option "port"
not_empty_env_var "JOBSERVICE_SECRET"
if [[ "$(harbor_registryctl_conf_get "protocol")" != "http" ]] && \
[[ "$(harbor_registryctl_conf_get "protocol")" != "https" ]]; then
error "Protocol must be \"http\" or \"https\"!"
exit 1
fi
local validate_port_args=()
! am_i_root && validate_port_args+=("-unprivileged")
if ! err=$(validate_port "${validate_port_args[@]}" "$(harbor_registryctl_conf_get "port")"); then
error "An invalid port was specified: $err"
exit 1
fi
}
# Ensure Harbor Registryctl settings are valid
harbor_registryctl_validate

View File

@@ -0,0 +1,18 @@
version: '2'
services:
harbor-registryctl:
image: bitnami/harbor-registryctl:1
ports:
- 80:8080
environment:
- CORE_SECRET=not-a-secure-core-secret
- JOBSERVICE_SECRET=not-a-secure-jobservice-secret
volumes:
- harbor-registry_data:/storage
- ./config/registry/:/etc/registry/:ro
- ./config/registryctl/config.yml:/etc/registryctl/config.yml:ro
volumes:
harbor-registry_data:
driver: local