Makefile 640 B

12345678910111213141516
  1. IMAGE_NAME = gearmand
  2. IMAGE_VERSION = 1.1.21
  3. USE_CACHE ?=
  4. image:
  5. @echo "Building Docker image ${IMAGE_NAME}:${IMAGE_VERSION}..."
  6. -docker build $(USE_CACHE) --network=host --build-arg version=$(IMAGE_VERSION) -t $(IMAGE_NAME):$(IMAGE_VERSION) .
  7. -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi)
  8. image-no-cache:
  9. $(MAKE) -e USE_CACHE=--no-cache
  10. latest: image
  11. @echo "Tagging Docker image ${IMAGE_NAME}:${IMAGE_VERSION} with latest..."
  12. -docker tag `docker image ls --format '{{.ID}}' $(IMAGE_NAME):$(IMAGE_VERSION)` $(IMAGE_NAME):latest
  13. -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi)