-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile.scala
35 lines (24 loc) · 1.08 KB
/
Makefile.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
LOCAL_IMAGE ?= radanalytics-scala-spark
# If you are going to push the built image to a registry
# using the "push" make target then you should replace
# "project" with an appropriate path for your registry and/or project
PUSH_IMAGE=project/radanalytics-scala-spark
DOCKERFILE_CONTEXT=scala-build
.PHONY: build push clean clean-context context zero-tarballs
build: $(DOCKERFILE_CONTEXT)
docker build --pull -t $(LOCAL_IMAGE) $(DOCKERFILE_CONTEXT)
push: build
docker tag $(LOCAL_IMAGE) $(PUSH_IMAGE)
docker push $(PUSH_IMAGE)
clean: clean-context
-docker rmi $(LOCAL_IMAGE) $(PUSH_IMAGE)
clean-context:
-rm -rf $(DOCKERFILE_CONTEXT)/*
context: $(DOCKERFILE_CONTEXT)
$(DOCKERFILE_CONTEXT): $(DOCKERFILE_CONTEXT)/Dockerfile $(DOCKERFILE_CONTEXT)/modules
$(DOCKERFILE_CONTEXT)/Dockerfile $(DOCKERFILE_CONTEXT)/modules:
cekit --descriptor image.scala.yaml build --dry-run docker
cp -R target/image/* $(DOCKERFILE_CONTEXT)
zero-tarballs:
find ./$(DOCKERFILE_CONTEXT) -name "*.tgz" -type f -exec truncate -s 0 {} \;
find ./$(DOCKERFILE_CONTEXT) -name "*.tar.gz" -type f -exec truncate -s 0 {} \;