Build with build args

Pass build-time variables into Dockerfile ARG instructions

docker build --build-arg VERSION=1.2.3 --build-arg ENV=prod -t img:tag .

tool
docker46 commands
tags
docker

More docker commands

  • trivy image --exit-code 1 --severity HIGH,CRITICAL img:tag

    Fail pipeline if HIGH or CRITICAL CVEs found

  • docker sbom img:tag

    Generate Software Bill of Materials for an image (Docker Desktop)

  • docker inspect <container> | jq '.[0].NetworkSettings.Networks'

    Drill into network settings of a running container

  • docker compose up -d --build

    Build and start all services in background

  • docker compose logs -f --tail=100 <service>

    Stream last 100 lines and follow a compose service

all 46 docker commands