Files
openstack-helm-infra/tools/pull-images.sh
intlabs fa041ea6da ImagePuller: add sudo for use when user is not in docker group
This PS adds sudo to the image puller commands to enable use when
the user is not in the docker group.

Change-Id: Ic2c2577e830f3db93952b72a92d360da83fb1a16
2017-11-03 00:28:54 -05:00

24 lines
937 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2017 The Openstack-Helm 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 -x
ALL_IMAGES="$(./tools/image-repo-overides.sh | \
python -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout)' | \
jq '.bootstrap.preload_images |map(.) | join(" ")' | tr -d '"')"
for IMAGE in ${ALL_IMAGES}; do
sudo -H docker inspect $IMAGE > /dev/null || sudo -H docker pull $IMAGE
done