Skip to content

Commit

Permalink
Add scratch image generation util
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzs90 committed Feb 9, 2021
1 parent 0d8e473 commit 660eeac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util-images/scratch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
ARG FILENAME

COPY $FILENAME /
22 changes: 22 additions & 0 deletions util-images/scratch/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PROJECT ?= k8s-testimages
IMG = gcr.io/$(PROJECT)/perf-tests-util/scratch
NUM_IMAGES ?= 20

all: push

build: Dockerfile
TAG=1 ; while [[ $$TAG -le $(NUM_IMAGES) ]] ; do \
touch $$TAG ; \
docker build --build-arg FILENAME=$$TAG -t $(IMG):$$TAG . ; \
rm $$TAG ; \
echo Built $(IMG):$$TAG ; \
((TAG = TAG + 1)) ; \
done

.PHONY: push
push: build
TAG=1 ; while [[ $$TAG -le $(NUM_IMAGES) ]] ; do \
docker push $(IMG):$$TAG ; \
echo Pushed $(IMG) with :$$TAG tags ; \
((TAG = TAG + 1)) ; \
done
9 changes: 9 additions & 0 deletions util-images/scratch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# scratch

Utility image for padding kubemark hosts to achieve more realistic node object sizes. Refer to issue https://github.com/kubernetes/kubernetes/issues/90833.

## Releasing

1. Configure the number of images to build / push.
1. Build with `make build`
1. Release with `make push`

0 comments on commit 660eeac

Please sign in to comment.