#!/bin/bash

set -eu

bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

. $bindir/_docker.sh
. $bindir/_tag.sh

docker_image() {
    repo="$(docker_repo "$1")"
    docker image ls \
        --format "{{printf \"%-16s %-10s\" \"$1\" \"${2}\"}} {{.Size | printf \"%6s\"}}  {{.ID}}  {{.CreatedAt}}" \
        "${repo}:${2}"
}

tag=$(head_root_tag)

for img in proxy proxy-init controller web cli-bin ; do
    docker_image "$img" "$tag"
done

docker_image go-deps      "$(go_deps_sha)"
