Moshe | 0bb532c | 2018-02-26 13:39:57 +0200 | [diff] [blame] | 1 | ############################################################################## |
| 2 | # Copyright 2018 EuropeanSoftwareMarketingLtd. |
| 3 | # =================================================================== |
| 4 | # Licensed under the ApacheLicense, Version2.0 (the"License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # software distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and limitations under |
| 12 | # the License |
| 13 | ############################################################################## |
| 14 | # vnftest comment: this is a modified copy of |
| 15 | # yardstick/docker/Makefile |
| 16 | |
| 17 | SHELL = /bin/bash |
| 18 | |
Moshe | 4e0a607 | 2018-03-29 09:14:00 +0300 | [diff] [blame] | 19 | IMAGE = onap/vnfsdk/vnftest |
Moshe | 0bb532c | 2018-02-26 13:39:57 +0200 | [diff] [blame] | 20 | |
| 21 | DOCKER_TAG = beijing.0 |
| 22 | |
| 23 | .PHONY: all |
| 24 | all: .docker |
| 25 | |
| 26 | .docker: |
| 27 | /usr/bin/docker build --rm=true --no-cache=true -t $(IMAGE):$(DOCKER_TAG) . |
Chris Donley | bfb67b9 | 2018-05-17 14:06:03 -0700 | [diff] [blame] | 28 | /usr/bin/docker tag $(IMAGE):$(DOCKER_TAG) $(IMAGE):1.1.0 |
Moshe | 0bb532c | 2018-02-26 13:39:57 +0200 | [diff] [blame] | 29 | touch .docker |
| 30 | |
| 31 | |
| 32 | .PHONY: clean |
| 33 | clean: |
| 34 | @docker ps | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker stop |
| 35 | @docker ps -a | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker rm |
| 36 | @echo "Docker images to remove:" |
| 37 | @docker images | head -1 && docker images | grep $(IMAGE) || true |
| 38 | @image_tags=($$(docker images | grep $(IMAGE) | awk '{print $$2}')) ; \ |
| 39 | for tag in "$${image_tags[@]}"; do \ |
| 40 | echo "Removing docker image $(IMAGE):$$tag..." ; \ |
| 41 | docker rmi $(IMAGE):$$tag ; \ |
| 42 | done |
| 43 | rm -f .docker |