blob: 4f9e18b9dfa76f7ef9e8406b1815cf1cd7e375ef [file] [log] [blame]
Moshe0bb532c2018-02-26 13:39:57 +02001##############################################################################
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
17SHELL = /bin/bash
18
19IMAGE = onap/vnftest
20
21DOCKER_TAG = beijing.0
22
23.PHONY: all
24all: .docker
25
26.docker:
27 /usr/bin/docker build --rm=true --no-cache=true -t $(IMAGE):$(DOCKER_TAG) .
28 /usr/bin/docker tag $(IMAGE):$(DOCKER_TAG) $(IMAGE):latest
29 touch .docker
30
31
32.PHONY: clean
33clean:
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