Advertisement
mikelieman

Makefile for Dockerfile

Dec 27th, 2020
2,494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.92 KB | None | 0 0
  1. #
  2. #  Documentation goes here
  3. #
  4.  
  5. ###########################################################
  6. ## Define Repo & Tag, nothing else changes here
  7.  
  8. REPO = localhost/csny/bugzillad_ol8
  9. TAG = latest
  10.  
  11. ###########################################################
  12.  
  13. BUILDAH_EXE = /usr/bin/buildah
  14.  
  15. default : usage
  16.  
  17. usage :
  18.         @echo
  19.         @echo Image Will Be Stored To
  20.         @echo -----------------------
  21.         @echo REPO = $(REPO)
  22.         @echo TAG  = $(TAG)
  23.         @echo
  24.         @echo Makefile Targets
  25.         @echo ----------------
  26.         @echo clean
  27.         @echo clean-dangling
  28.         @echo image
  29.         @echo
  30.  
  31. clean :
  32.         -find . -name \*~ -exec rm -f {} \;
  33.         -$(BUILDAH_EXE) rm `$(BUILDAH_EXE) ps -q`
  34.  
  35. clean-dangling :
  36.         sudo $(BUILDAH_EXE) images -q -f=dangling=true | xargs sudo $(BUILDAH_EXE) rmi
  37.  
  38. image :
  39.         sudo $(BUILDAH_EXE) build-using-dockerfile -t $(REPO):$(TAG) .
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement