blob: 5aef76b27b199f279501bd96f63717dab38619ba [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
Moshe4e0a6072018-03-29 09:14:00 +030019IMAGE = onap/vnfsdk/vnftest
Moshe0bb532c2018-02-26 13:39:57 +020020
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) .
Chris Donleybfb67b92018-05-17 14:06:03 -070028 /usr/bin/docker tag $(IMAGE):$(DOCKER_TAG) $(IMAGE):1.1.0
Moshe0bb532c2018-02-26 13:39:57 +020029 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