Skip to content

Instantly share code, notes, and snippets.

@nmasse-itix
Created April 27, 2018 06:03
Show Gist options
  • Save nmasse-itix/864d25ab6faf6b67615fe7076ee1862d to your computer and use it in GitHub Desktop.
Save nmasse-itix/864d25ab6faf6b67615fe7076ee1862d to your computer and use it in GitHub Desktop.
Fetch Docker images with Skopeo
#!/bin/bash
IMAGES="jboss-eap-7/eap70-openshift openshift3/jenkins-2-rhel7 openshift3/jenkins-slave-maven-rhel7 openshift3/jenkins-slave-nodejs-rhel7 dotnet/dotnet-20-jenkins-slave-rhel7 openshift3/jenkins-slave-base-rhel7 rhscl/mongodb-34-rhel7 rhscl/mysql-57-rhel7 rhscl/mariadb-102-rhel7 rhscl/postgresql-96-rhel7 rhscl/nodejs-6-rhel7 rhscl/s2i-base-rhel7 openshift3/apb-base rhel7-atomic rhel7 rhscl/ruby-24-rhel7 rhscl/perl-524-rhel7 rhscl/python-27-rhel7 rhscl/python-36-rhel7 redhat-sso-7/sso71-openshift"
for i in $IMAGES; do
file="$(echo $i|tr '/' '_').tar"
if [ ! -f "$file" -a ! -f "$file.gz" ]; then
echo "Fetching $i... into $file..."
skopeo copy docker://registry.access.redhat.com/$i:latest docker-archive://$PWD/$file:$i:latest
fi
if [ -f "$file" -a ! -f "$file.gz" ]; then
echo "Compressing $file..."
gzip "$file"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment