overleaf/server-ce/Makefile
Alf Eaton 29abca700c Only pull cached base image for x86_64 (#17043)
GitOrigin-RevId: a45325ffece66288fc1d53e60622ad4ec432f53b
2024-02-16 09:04:40 +00:00

24 lines
806 B
Makefile

# Makefile
export OVERLEAF_BASE_TAG := sharelatex/sharelatex-base
export OVERLEAF_TAG := sharelatex/sharelatex
export OVERLEAF_BASE_CACHE := $(shell echo $(OVERLEAF_BASE_TAG) | sed -E 's/(.+):.+/\1:latest/')
export MONOREPO_REVISION := $(shell git rev-parse HEAD)
MONOREPO_ROOT := ../
all: build-base build-community
build-base:
cp .dockerignore $(MONOREPO_ROOT)
ifeq ($(shell uname -m),x86_64)
docker pull $(OVERLEAF_BASE_CACHE) || echo "nothing cached yet"
endif
docker build -f Dockerfile-base --pull --cache-from $(OVERLEAF_BASE_CACHE) -t $(OVERLEAF_BASE_TAG) $(MONOREPO_ROOT)
build-community:
cp .dockerignore $(MONOREPO_ROOT)
docker build --build-arg OVERLEAF_BASE_TAG --build-arg MONOREPO_REVISION -f Dockerfile -t $(OVERLEAF_TAG) $(MONOREPO_ROOT)
.PHONY: all build-base build-community