mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 23:55:33 -05:00
f5701b67eb
[server-ce] docker image caching GitOrigin-RevId: 161d775485d6b8f994d1a6e53440a586fb9a5058
42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
# Makefile
|
|
|
|
MONOREPO_ROOT := ../
|
|
export MONOREPO_REVISION := $(shell git rev-parse HEAD)
|
|
export BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
|
export OVERLEAF_BASE_BRANCH ?= sharelatex/sharelatex-base:$(BRANCH_NAME)
|
|
export OVERLEAF_BASE_LATEST ?= sharelatex/sharelatex-base
|
|
export OVERLEAF_BASE_TAG ?= sharelatex/sharelatex-base:$(BRANCH_NAME)-$(MONOREPO_REVISION)
|
|
export OVERLEAF_TAG_BRANCH ?= sharelatex/sharelatex:$(BRANCH_NAME)
|
|
export OVERLEAF_TAG_LATEST ?= sharelatex/sharelatex
|
|
export OVERLEAF_TAG ?= sharelatex/sharelatex:$(BRANCH_NAME)-$(MONOREPO_REVISION)
|
|
|
|
all: build-base build-community
|
|
|
|
build-base:
|
|
cp .dockerignore $(MONOREPO_ROOT)
|
|
docker build \
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
--file Dockerfile-base \
|
|
--pull \
|
|
--cache-from $(OVERLEAF_BASE_LATEST) \
|
|
--cache-from $(OVERLEAF_BASE_BRANCH) \
|
|
--tag $(OVERLEAF_BASE_TAG) \
|
|
--tag $(OVERLEAF_BASE_BRANCH) \
|
|
$(MONOREPO_ROOT)
|
|
|
|
|
|
build-community:
|
|
cp .dockerignore $(MONOREPO_ROOT)
|
|
docker build \
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
--build-arg OVERLEAF_BASE_TAG \
|
|
--build-arg MONOREPO_REVISION \
|
|
--cache-from $(OVERLEAF_LATEST) \
|
|
--cache-from $(OVERLEAF_BRANCH) \
|
|
--file Dockerfile \
|
|
--tag $(OVERLEAF_TAG) \
|
|
--tag $(OVERLEAF_BRANCH) \
|
|
$(MONOREPO_ROOT)
|
|
|
|
|
|
.PHONY: all build-base build-community
|