azubis/basics/build.sh
2025-02-26 10:57:14 +01:00

15 lines
382 B
Bash
Executable file

#!/bin/bash
# ─< Check if the given command exists silently >─────────────────────────────────────────
command_exists() {
command -v "$@" >/dev/null 2>&1
}
NAME="testimage"
TAG="latest"
if command_exists docker; then
if [ -e Dockerfile ]; then
docker build -t "${NAME}:${TAG}" .
fi
fi