Skip to content

Commit

Permalink
add clean_none target for cleaning <none> tags
Browse files Browse the repository at this point in the history
prevent errors when cleaning
move latest to last place to prevent wrong build order
  • Loading branch information
oikuda committed May 15, 2019
1 parent ccb4927 commit 5b34b04
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = imunes/template
TAGS = latest debian-8 debian-9-min ubuntu-18.04-min debian-9 ubuntu-18.04
TAGS = debian-8 debian-9-min ubuntu-18.04-min debian-9 ubuntu-18.04 latest
clean_TAGS = $(addprefix clean_,$(TAGS))
push_TAGS = $(addprefix push_,$(TAGS))

Expand Down Expand Up @@ -29,13 +29,17 @@ $(push_TAGS):

build_all: $(TAGS)

clean_all:
clean_none:
docker rmi `docker images | grep '^<none>' | awk '{print $3}'` 2> /dev/null || true
docker rmi `docker images $(NAME) | grep '<none>' | awk '{print $3}'` 2> /dev/null || true

clean_all: clean_none
for tag in $(TAGS); do \
docker rmi $(NAME):$$tag ; \
done
docker rmi $(NAME):$$tag 2> /dev/null || true; \
done

push_all:
docker login
for tag in $(TAGS); do \
docker push $(NAME):$$tag ; \
done
done

0 comments on commit 5b34b04

Please sign in to comment.