Created
June 26, 2019 15:44
-
-
Save kenperkins/52dbc16a65092106118655256bdc905c to your computer and use it in GitHub Desktop.
Push Pull images to public/private registry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sample exectuion | |
# csvFile=images.csv ./push-pull.sh | tee output.log | |
# content should be in the format of sourcepath,containername,containerversion | |
# if sourcepath is empty, i.e. redis:1.2.3 it should be ,redis,1.2.3 | |
# You'll need to docker login to your upstream with admin credentials if there are | |
# any new containers in the list | |
# upstream repo | |
upstream=quay.io/rackspace | |
while read -r line | |
do | |
sourcepath=$(echo $line | awk -F',' '{printf "%s", $1}' | tr -d '"') | |
containername=$(echo $line | awk -F',' '{printf "%s", $2}' | tr -d '"') | |
containerversion=$(echo $line | awk -F',' '{printf "%s", $3}' | tr -d '"') | |
if [ "${sourcepath}" == "" ]; then | |
docker pull $containername:$containerversion | |
docker tag $containername:$containerversion $upstream/$containername:$containerversion | |
else | |
docker pull $sourcepath/$containername:$containerversion | |
docker tag $sourcepath/$containername:$containerversion $upstream/$containername:$containerversion | |
fi | |
docker push quay.io/rackspace/$containername:$containerversion | |
done < $csvFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcr.io/google-containers | startup-script | v1 | |
---|---|---|---|
quay.io/kubernetes-ingress-controller | nginx-ingress-controller | 0.14.0 | |
gcr.io/google_containers | defaultbackend | 1.4 | |
k8s.gcr.io | kubernetes-dashboard-amd64 | v1.10.1 | |
k8s.gcr.io | heapster-influxdb-amd64 | v1.3.3 | |
k8s.gcr.io | heapster-amd64 | v1.5.3 | |
bobrik | curator | 5.5.4 | |
docker.elastic.co/elasticsearch | elasticsearch | 6.4.0 | |
gcr.io/google_containers | addon-resizer | 1.0 | |
quay.io/prometheus | node-exporter | v0.15.0 | |
quay.io/coreos | prometheus-operator | v0.25.0 | |
quay.io/coreos | configmap-reload | v0.0.1 | |
justwatch | elasticsearch_exporter | 1.0.2 | |
gcr.io/google_containers | node-problem-detector | v0.4.1 | |
vmware | postgresql | 9.6.5-photon | |
vmware | harbor-jobservice | v1.5.2 | |
vmware | harbor-db | v1.5.2 | |
redis | 4.0.11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment