--- # https://taskfile.dev version: "3" vars: DOCKERFILE: "build/Dockerfile" GIT_VERSION: sh: git describe --tags --always GIT_COMMIT: sh: git rev-parse HEAD tasks: lint: cmds: - hadolint {{.DOCKERFILE}} -t none build: run: once cmd: | # Build with caching enabled docker build \ --build-arg "GIT_VERSION={{.GIT_VERSION}}" \ --build-arg "GIT_COMMIT={{.GIT_COMMIT}}" \ --cache-from {{.IMAGE_NAME}}:latest \ --build-arg BUILDKIT_INLINE_CACHE=1 \ -t {{.IMAGE_NAME}}:latest \ -t {{.IMAGE_NAME}}:{{.GIT_VERSION}} \ -f {{.DOCKERFILE}} . build:debug: run: once cmd: | # Build debug image with Delve debugger docker build \ --build-arg "GIT_VERSION={{.GIT_VERSION}}" \ --build-arg "GIT_COMMIT={{.GIT_COMMIT}}" \ -t {{.IMAGE_NAME}}:debug \ -f build/Dockerfile.debug .