Skip to content

Commit

Permalink
chore(build-check): Add check script to verify that docker images use…
Browse files Browse the repository at this point in the history
…d in registry are valid.

Signed-off-by: Sun Tan <sutan@redhat.com>
  • Loading branch information
sunix committed Jan 25, 2021
1 parent 68a9a70 commit 0aad25a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN ./check_metas_schema.sh v3
RUN if [[ ${USE_DIGESTS} == "true" ]]; then ./write_image_digests.sh v3;fi
RUN ./index.sh v3 > /build/v3/plugins/index.json
RUN ./list_referenced_images.sh v3 > /build/v3/external_images.txt
RUN ./check_referenced_images < /build/v3/external_images.txt
RUN chmod -R g+rwX /build

# Build registry, copying meta.yamls and index.json from builder
Expand Down
18 changes: 18 additions & 0 deletions build/scripts/check_referenced_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
#
# Copyright (c) 2019-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0

# Check with skopeo that images are valid. Image list should be passed through stdin.
set -e

while read extenal_image
do
echo "Checking that $extenal_image is a valid image";
skopeo inspect "docker://$extenal_image" >/dev/null;
echo "... OK";
done

0 comments on commit 0aad25a

Please sign in to comment.