#!/bin/bash usage() { # Function: Print a help message. echo "Image Build Script: Creates one or more images using a target in the docker-bake.hcl file" echo "USAGE: $0 buildtarget " echo "valid targets: ${targets[*]}; default: dev" echo no argument options: echo "-c try out the image by starting a container terminal therein, for dev target this is the default;" echo "-x exclude distro from image name;" echo "-n for --no_cache" echo "-p push to repository; after build push to repository default is hub.docker.common (not need for deploy target)" echo required argument options: echo "-d supported: alpine, debian, ubuntu, default: alpine; if base image set distro will be determined" echo "-t tag following : in output image name (i.e. REPO/USER/NAME:TAG), default: latest" echo "-u ; repository user prefix in output image name (i.e. REPO/USER/NAME:TAG)" echo "-r ; private repo name, do not use for hub.docker.com (docker.io)" echo "-b ; used in FROM in Dockerfile, default is official distro image (e.g. alpine:latest)" echo "-w ; set a custom WORKDIR in Dockerfile, default is /opt/build" }