Downloading Images from AppViewX Repository

Prerequisites

  1. Get the source image repository credentials from AppViewX.
  2. Configure the docker using the command
    docker login -u ${USERNAME} -p ${PASSWORD} ${DOCKER_REPOSITORY}
  3. Configure the respective cloud provider CLI (Azure) and ensure you have access to push docker images to ACR.

The script for image push and pull is as follows:

#!/bin/bash
# Pre requisite
# Get the source image repository credentials from Appviewx and then configure docker using `docker login -u ${USERNAME} -p ${PASSWORD} ${DOCKER_REPOSITORY}`
# Configure the respective cloud provider cli (aws/az/gcloud) and make sure that the user has access to push docker images to ACR/ECR/GCR.

appVersion=$1 # App image version. E.g: 2026.1.0_FP_750-alpine
targetImageRegistry=$2 # Image resgistry name

# Validate required inputs
if [ -z "$appVersion" ] || [ -z "$targetImageRegistry" ];then
{
    echo "Please provide script parametes as ./script.sh <appVersion> <targetImageRegistry>"
    exit
}
fi

# Set the registry login
if echo $targetImageRegistry | grep -iq "amazonaws";then
{
    registryProvider="ecr"
    region=$(echo $targetImageRegistry | cut -d "." -f4)
    aws ecr get-login-password --region $region | docker login --username AWS --password-stdin $targetImageRegistry
}
elif echo $targetImageRegistry | grep -iq "azurecr";then
{
    registryProvider="acr"
    az acr login -n $targetImageRegistry
}
elif echo $targetImageRegistry | grep -iq "gcr";then
{
    registryProvider="gcr"
    gcloud auth print-access-token | docker login -u oauth2accesstoken \
    --password-stdin $(echo $targetImageRegistry | cut -d '/' -f2)
}
else
{
    echo "Unknown registry provider"
    exit 2
}
fi

# Image tag mappings
imageTags='[{
        "imageName": "avx-cloud-managedservice-mks",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "avx-cloud-web",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "avx-cloud-gateway",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "avx-platform-report-generator",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "mongo-init",
        "tagVersion": "appVersion",
        "upload": true,
        "ocp": false
    },
    {
        "imageName": "avx-cloud-mongoseed",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "avx-python-sandbox",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "avx-mid-server-base",
        "tagVersion": "appVersion",
        "upload": true
    },
    {
        "imageName": "alpine",
        "tagVersion": "3.22.1",
        "upload": true
    },
    {
        "imageName": "mongodb",
        "tagVersion": "8.0.17",
        "upload": true,
        "ocp": true
    },
    {
        "imageName": "pilot",
        "tagVersion": "1.28.0",
        "upload": true
    },
    {
        "imageName": "proxyv2",
        "tagVersion": "1.28.0",
        "upload": true
    },
    {
        "imageName": "openbao",
        "tagVersion": "2.4.1",
        "upload": true
    },
    {
        "imageName": "redis",
        "tagVersion": "8.2.2",
        "upload": true,
        "ocp": false
    },
    {
        "imageName": "redis",
        "tagVersion": "8.2.2-ocp",
        "upload": true,
        "ocp": true
    },
    {
        "imageName": "redis-sentinel",
        "tagVersion": "8.2.2",
        "upload": true,
        "ocp": true
    },
    {
        "imageName": "kafka",
        "tagVersion": "0.48.0-kafka-4.1.0",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "strimzi-operator",
        "tagVersion": "0.48.0",
        "upload": true
    },
    {
        "imageName": "kube-metrics-adapter",
        "tagVersion": "v0.2.6",
        "upload": true
    },
    {
        "imageName": "kibana",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "grafana",
        "tagVersion": "12.3.0",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "filebeat",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "logstash",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "logstash-syslog",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "elasticsearch",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "elasticsearch-insight",
        "tagVersion": "9.1.4",
        "upload": true,
        "monitoring": true
    },
    {
        "imageName": "prometheus",
        "tagVersion": "v3.5.0",
        "upload": true,
        "ocp": false
    },
    {
    	"imageName" : "backup-utility-image",
    	"tagVersion": "v2026.1.0",
        "upload": true
    },
    {
    	"imageName" : "alertmanager",
    	"tagVersion": "v0.28.1",
        "upload": true,
        "monitoring": true
    },
    {
    	"imageName" : "node-exporter",
    	"tagVersion": "v1.9.1",
        "upload": true,
        "monitoring": true
    },
    {
    	"imageName" : "metrics-server",
    	"tagVersion": "v0.8.0",
        "upload": true
    },
    {
    	"imageName" : "kube-state-metrics",
    	"tagVersion": "v2.17.0",
        "upload": true
    },
    {
    	"imageName" : "redis_exporter",
    	"tagVersion": "v1.77.0",
        "upload": true
    }
]'

for row in $(echo "${imageTags}" | jq -r '.[] | @base64'); do
    _jq() {
     echo ${row} | base64 --decode | jq -r ${1}
    }
    imageUpload=$(_jq '.upload')
    tagVersion=$(_jq '.tagVersion')
    if [ $imageUpload == "true" ];then
    {
        if [ "${tagVersion}" == "appVersion" ];then
        {
            docker pull images.appviewx.com/appviewx/$(_jq '.imageName'):$appVersion
            docker tag images.appviewx.com/appviewx/$(_jq '.imageName'):$appVersion $targetImageRegistry/appviewx/$(_jq '.imageName'):$appVersion
            docker push $targetImageRegistry/appviewx/$(_jq '.imageName'):$appVersion
        }
        else
        {
            docker pull images.appviewx.com/appviewx/$(_jq '.imageName'):$(_jq '.tagVersion')
            docker tag images.appviewx.com/appviewx/$(_jq '.imageName'):$(_jq '.tagVersion') $targetImageRegistry/appviewx/$(_jq '.imageName'):$(_jq '.tagVersion')
            docker push $targetImageRegistry/appviewx/$(_jq '.imageName'):$(_jq '.tagVersion')
        }
        fi
    }
    fi
done

Execute the Image Push-Pull Script

To execute the above image push-pull script, run the command
./avx_image_pull_push.sh <image-tag> <targetImageRegistry>
Note: Contact AppViewX Support for the <image-tag>.