verify-build.sh

Created about 12 hours ago

attributes
source_pathscripts/verify-build.sh
source_sha256d52633ba734587b1a0513366a4e13f771edff538492c42df8020d74d2ba7532b
source_urlhttps://github.com/docker/skills/blob/ce4693b88722334625780ca8e9d54201b2d96f6d/skills/docker-build-strategies/scripts/verify-build.sh
supporting_skill_id40167
upstream_revisionce4693b88722334625780ca8e9d54201b2d96f6d
#!/usr/bin/env bash
# Verify Dockerfile build. Run from the project root.
# Usage: bash "<skill-dir>/scripts/verify-build.sh" [--help] [IMAGE_NAME]
# <skill-dir> is the directory that contains this skill's SKILL.md.
set -euo pipefail

usage() {
    echo "Usage: bash \"<skill-dir>/scripts/verify-build.sh\" [--help] [IMAGE_NAME]"
    echo "Run from the project root; <skill-dir> is the directory that contains this skill's SKILL.md."
    echo "Builds the Dockerfile, then reports image size and configured user."
}

if [[ "${1:-}" == "--help" && $# == 1 ]]; then
    usage
    exit 0
fi

if (( $# > 1 )); then
    usage >&2
    exit 2
fi

IMAGE="${1:-verify-build-test}"

echo "Building image..."
docker build -t "$IMAGE" .

echo ""
echo "Image size:"
docker images "$IMAGE" --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"

echo ""
echo "User:"
docker inspect "$IMAGE" --format '{{.Config.User}}'

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.