Makefile 806 B

123456789101112131415161718192021222324
  1. # Makefile
  2. export OVERLEAF_BASE_TAG := sharelatex/sharelatex-base
  3. export OVERLEAF_TAG := sharelatex/sharelatex
  4. export OVERLEAF_BASE_CACHE := $(shell echo $(OVERLEAF_BASE_TAG) | sed -E 's/(.+):.+/\1:latest/')
  5. export MONOREPO_REVISION := $(shell git rev-parse HEAD)
  6. MONOREPO_ROOT := ../
  7. all: build-base build-community
  8. build-base:
  9. cp .dockerignore $(MONOREPO_ROOT)
  10. ifeq ($(shell uname -m),x86_64)
  11. docker pull $(OVERLEAF_BASE_CACHE) || echo "nothing cached yet"
  12. endif
  13. docker build -f Dockerfile-base --pull --cache-from $(OVERLEAF_BASE_CACHE) -t $(OVERLEAF_BASE_TAG) $(MONOREPO_ROOT)
  14. build-community:
  15. cp .dockerignore $(MONOREPO_ROOT)
  16. docker build --build-arg OVERLEAF_BASE_TAG --build-arg MONOREPO_REVISION -f Dockerfile -t $(OVERLEAF_TAG) $(MONOREPO_ROOT)
  17. .PHONY: all build-base build-community