Skip to content

Instantly share code, notes, and snippets.

@garethahealy
Last active February 15, 2017 12:53
Show Gist options
  • Save garethahealy/4f8a14e2e85894f9c462030d51081b87 to your computer and use it in GitHub Desktop.
Save garethahealy/4f8a14e2e85894f9c462030d51081b87 to your computer and use it in GitHub Desktop.
cache redhat images
sudo su
yum install -y skopeo
oc login -u admin -p admin address-of-cluster:8443
oc new-project openshift3
TOKEN=$(oc whoami -t)
OCP_VERSION="3.3.0"
OCP_VERSION_LONG="v3.3.0.34"
REGISTRY="registry.access.redhat.com"
CENTRAL_REGISTRY="my-registry-route-address-of-cluster"
# Import core images
skopeo copy docker://$REGISTRY/openshift3/ose-pod:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-pod:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/ose-deployer:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-deployer:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/ose-haproxy-router:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-haproxy-router:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/ose-docker-registry:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-docker-registry:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
# Import builder images
skopeo copy docker://$REGISTRY/openshift3/ose-docker-builder:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-docker-builder:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/ose-sti-builder:$OCP_VERSION_LONG atomic:$CENTRAL_REGISTRY/openshift3/ose-sti-builder:$OCP_VERSION_LONG --dest-creds=admin:$TOKEN
# Import logging images
skopeo copy docker://$REGISTRY/openshift3/logging-deployer:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-deployer:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/logging-kibana:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-kibana:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/logging-fluentd:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-fluentd:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/logging-elasticsearch:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-elasticsearch:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/logging-curator:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-curator:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/logging-auth-proxy:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/logging-auth-proxy:$OCP_VERSION --dest-creds=admin:$TOKEN
# Import metric images
skopeo copy docker://$REGISTRY/openshift3/metrics-deployer:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/metrics-deployer:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/metrics-cassandra:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/metrics-cassandra:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/metrics-hawkular-metrics:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/metrics-hawkular-metrics:$OCP_VERSION --dest-creds=admin:$TOKEN
skopeo copy docker://$REGISTRY/openshift3/metrics-heapster:$OCP_VERSION atomic:$CENTRAL_REGISTRY/openshift3/metrics-heapster:$OCP_VERSION --dest-creds=admin:$TOKEN
# Delete all ImageStreams, as we'll import them with all tags
oc delete is --all -n openshift3
# Import core image stream tags
oc import-image openshift3/ose-pod --from=$REGISTRY/openshift3/ose-pod --all=true --confirm=true
oc import-image openshift3/ose-deployer --from=$REGISTRY/openshift3/ose-deployer --all=true --confirm=true
oc import-image openshift3/ose-haproxy-router --from=$REGISTRY/openshift3/ose-haproxy-router --all=true --confirm=true
oc import-image openshift3/ose-docker-registry --from=$REGISTRY/openshift3/ose-docker-registry --all=true --confirm=true
# Import builder image stream tags
oc import-image openshift3/ose-docker-builder --from=$REGISTRY/openshift3/ose-docker-builder --all=true --confirm=true
oc import-image openshift3/ose-sti-builder --from=$REGISTRY/openshift3/ose-sti-builder --all=true --confirm=true
# Import logging image stream tags
oc import-image openshift3/logging-deployer --from=$REGISTRY/openshift3/logging-deployer --all=true --confirm=true
oc import-image openshift3/logging-kibana --from=$REGISTRY/openshift3/logging-kibana --all=true --confirm=true
oc import-image openshift3/logging-fluentd --from=$REGISTRY/openshift3/logging-fluentd --all=true --confirm=true
oc import-image openshift3/logging-elasticsearch --from=$REGISTRY/openshift3/logging-elasticsearch --all=true --confirm=true
oc import-image openshift3/logging-curator --from=$REGISTRY/openshift3/logging-curator --all=true --confirm=true
oc import-image openshift3/logging-auth-proxy --from=$REGISTRY/openshift3/logging-auth-proxy --all=true --confirm=true
# Import metric image stream tags
oc import-image openshift3/metrics-deployer --from=$REGISTRY/openshift3/metrics-deployer --all=true --confirm=true
oc import-image openshift3/metrics-cassandra --from=$REGISTRY/openshift3/metrics-cassandra --all=true --confirm=true
oc import-image openshift3/metrics-hawkular-metrics --from=$REGISTRY/openshift3/metrics-hawkular-metrics --all=true --confirm=true
oc import-image openshift3/metrics-heapster --from=$REGISTRY/openshift3/metrics-heapster --all=true --confirm=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment