blob: 067ae919446a5c39b6f6cecc206443963c41dda9 [file] [log] [blame]
Scott Baker85d614f2017-02-01 14:30:40 -08001# Docker container Makefile for XOS
2#
3# Targets:
4#
5# `base` - XOS prerequistie files, no XOS code, builds xosproject/xos-base
6# `build` - base + XOS code, git pulled in Dockerfile from main repo,
7# builds xosproject/xos
8# `custom` - base + XOS code, git pulled in Dockerfile from selectable repo,
9# builds xosproject/xos
10# `devel` - base + XOS code from local directory, builds xosproject/xos
11# `test` - xosproject/xos + nodejs testing frameworks, builds
12# xosproject/xos-test
13#
14
15NO_DOCKER_CACHE ?= false
16
17CONTAINER_NAME ?= chameleon
18IMAGE_NAME ?= xosproject/chameleon
19
20XOS_GIT_REPO ?= https://github.com/opencord/xos.git
21XOS_GIT_BRANCH ?= master
22
23XOS_GIT_COMMIT_HASH ?= $(shell git log --pretty=format:'%H' -n 1 || echo -n "unknown" )
24XOS_GIT_COMMIT_DATE ?= $(shell git log --pretty=format:'%ad' -n 1 || echo -n "unknown" )
25
26BUILD_ARGS =
27ifdef http_proxy
28BUILD_ARGS += --build-arg http_proxy=${http_proxy}
29endif
30ifdef https_proxy
31BUILD_ARGS += --build-arg https_proxy=${https_proxy}
32endif
33
34chameleon:
Scott Baker41b2b742017-02-10 16:55:18 -080035 rm -rf tmp.chameleon
36 cp -R /opt/cord/component/chameleon tmp.chameleon
Scott Baker85d614f2017-02-01 14:30:40 -080037 sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm \
Scott Baker41b2b742017-02-10 16:55:18 -080038 -f Dockerfile.chameleon -t ${IMAGE_NAME} ${BUILD_ARGS} .
39 rm -rf tmp.chameleon