Skip to content

Commit

Permalink
Always create fresh build context
Browse files Browse the repository at this point in the history
Avoid leftover files leaking into build context when compiling Docker
images.
  • Loading branch information
bobf committed Mar 27, 2021
1 parent c44ed1c commit 7c53ed2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 486 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
tag := $(shell git rev-parse --short --verify HEAD)
all: dev:=0
all:
all: build push

.PHONY: build
build:
cd app && $(MAKE) dev=${dev} tag=${tag}
cd agent && $(MAKE) dev=${dev} tag=${tag}
cd monitor && $(MAKE) dev=${dev} tag=${tag}
cd charts && $(MAKE) dev=${dev} tag=${tag}

.PHONY: push
push:
ifneq (1,$(dev))
$(MAKE) push
else
$(MAKE) push-dev
docker push skep/agent:dev
docker push skep/monitor:dev
docker push skep/app:dev
docker push skep/charts:dev
endif

push:
else
docker push skep/agent:${tag}
docker push skep/monitor:${tag}
docker push skep/app:${tag}
Expand All @@ -23,3 +26,4 @@ push:
docker push skep/monitor:latest
docker push skep/app:latest
docker push skep/charts:latest
endif
1 change: 1 addition & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ all:
mkdir -p .build/
ifeq (${dev},1)
cp Dockerfile Pipfile Pipfile.lock .build/
rm -f .build/build.tar
tar zcf .build/build.tar --exclude build.tar --exclude .build --exclude node_modules .
cp -r ../shared/skep .build/skep
cd .build/ && docker build . -t skep/app:dev
Expand Down
480 changes: 0 additions & 480 deletions app/files/main.css

This file was deleted.

0 comments on commit 7c53ed2

Please sign in to comment.