Scott Baker | 85d614f | 2017-02-01 14:30:40 -0800 | [diff] [blame] | 1 | # 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 | |
| 15 | NO_DOCKER_CACHE ?= false |
| 16 | |
| 17 | CONTAINER_NAME ?= chameleon |
| 18 | IMAGE_NAME ?= xosproject/chameleon |
| 19 | |
| 20 | XOS_GIT_REPO ?= https://github.com/opencord/xos.git |
| 21 | XOS_GIT_BRANCH ?= master |
| 22 | |
| 23 | XOS_GIT_COMMIT_HASH ?= $(shell git log --pretty=format:'%H' -n 1 || echo -n "unknown" ) |
| 24 | XOS_GIT_COMMIT_DATE ?= $(shell git log --pretty=format:'%ad' -n 1 || echo -n "unknown" ) |
| 25 | |
| 26 | BUILD_ARGS = |
| 27 | ifdef http_proxy |
| 28 | BUILD_ARGS += --build-arg http_proxy=${http_proxy} |
| 29 | endif |
| 30 | ifdef https_proxy |
| 31 | BUILD_ARGS += --build-arg https_proxy=${https_proxy} |
| 32 | endif |
| 33 | |
| 34 | chameleon: |
Scott Baker | 41b2b74 | 2017-02-10 16:55:18 -0800 | [diff] [blame] | 35 | rm -rf tmp.chameleon |
| 36 | cp -R /opt/cord/component/chameleon tmp.chameleon |
Scott Baker | 85d614f | 2017-02-01 14:30:40 -0800 | [diff] [blame] | 37 | sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm \ |
Scott Baker | 41b2b74 | 2017-02-10 16:55:18 -0800 | [diff] [blame] | 38 | -f Dockerfile.chameleon -t ${IMAGE_NAME} ${BUILD_ARGS} . |
| 39 | rm -rf tmp.chameleon |