containerized-data-importer/hack/build/build-cdi-func-test-registry-host.sh
annastopel 0a18aa3d09 Internal Docker registry host that is visible only inside teh cluster.
cdi-func-test-registry-host - a host that runs docker registry and is accessible from inside the cluster via
cdi-func-test-registry-host.kube-system host name. The registry is populated with images taken from /tmp/shared/images. It is used by functional tests.
Example of usage:
1. inspect
With skopeo acces registry to ispect image  built from /tmp/shared/images/tinyCore.iso
skopeo inspect --tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso

2. Copy
skopeo copy --src-tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso dir:/tmp/download

Technical details:
Registry is run in a dedicated  service cdi-func-test-registry-host.
In the same pod there are 3 containers:
1. cdi-func-test-registry - runs registry:2 with self signed certificate that listens on port 443
2. cdi-func-test-registry-init - used to pouplate /tmp/shared/images volume with images created from /test/images/tinuCore.iso and with certificate generated during container image build
3. cdi-func-test-registry-populate - encapsulted all images of /tmp/shared/images in docker images and pushes them to the registry
2019-01-06 09:43:40 +02:00

40 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
#Copyright 2018 The CDI Authors.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
set -euo pipefail
script_dir="$(readlink -f $(dirname $0))"
source "${script_dir}"/common.sh
source "${script_dir}"/config.sh
REGISTRY_INIT_PATH="tools/${FUNC_TEST_REGISTRY_INIT}"
${BUILD_DIR}/build-copy-artifacts.sh "${REGISTRY_INIT_PATH}"
OUT_PATH="${OUT_DIR}/tools"
mkdir -p "${OUT_PATH}/${FUNC_TEST_REGISTRY}"
mkdir -p "${OUT_PATH}/${FUNC_TEST_REGISTRY_POPULATE}"
mkdir -p "${OUT_PATH}/${FUNC_TEST_REGISTRY_INIT}"
DOCKER_REPO=""
cp ${BUILD_DIR}/docker/${FUNC_TEST_REGISTRY}/* ${OUT_PATH}/${FUNC_TEST_REGISTRY}/
cp ${BUILD_DIR}/docker/${FUNC_TEST_REGISTRY_POPULATE}/* ${OUT_PATH}/${FUNC_TEST_REGISTRY_POPULATE}/
cp -r ${BUILD_DIR}/docker/${FUNC_TEST_REGISTRY_INIT}/* ${OUT_PATH}/${FUNC_TEST_REGISTRY_INIT}/
cp "${CDI_DIR}/tests/images/tinyCore.iso" ${OUT_PATH}/${FUNC_TEST_REGISTRY_INIT}/