81189960db0a83505c49fe34d9d88c7b75762f4f
[yardstick.git] / ci / docker / Makefile
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 SHELL = /bin/bash
11
12 IMAGE = opnfv/yardstick-ci
13
14 .PHONY: all
15 all: .docker
16
17 .docker:
18         /usr/bin/docker build --rm=true --no-cache=true -t $(IMAGE):14.04 yardstick-ci
19         /usr/bin/docker tag -f $(IMAGE):14.04 $(IMAGE)
20         touch .docker
21
22 .PHONY: clean
23 clean:
24         docker ps | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker stop
25         docker ps -a | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker rm
26         docker images -a | grep $(IMAGE) | awk '{print $$3}' | sort | uniq | xargs -r docker rmi
27         rm -f .docker