|
#!/bin/bash
|
|
|
|
|
|
|
|
DOCKER_NAMESPACE=$1
|
|
|
|
if [ -z "$DOCKER_NAMESPACE" ]; then
|
|
echo "Usage: $0 <docker_namespace>"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
image_list=$(docker image ls --format '{{.Repository}}:{{.Tag}}' | grep sweb | grep -v $DOCKER_NAMESPACE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for image in $image_list; do
|
|
echo "=============================="
|
|
echo "Image: $image"
|
|
|
|
new_image_name=${image//__/_s_}
|
|
docker tag $image $DOCKER_NAMESPACE/$new_image_name
|
|
echo "Tagged $image to $DOCKER_NAMESPACE/$new_image_name"
|
|
|
|
docker push $DOCKER_NAMESPACE/$new_image_name
|
|
echo "Pushed $DOCKER_NAMESPACE/$new_image_name"
|
|
done
|
|
|